File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
ruby/ql/lib/codeql/ruby/ast/internal Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -579,12 +579,26 @@ abstract class StringlikeLiteralImpl extends Expr, TStringlikeLiteral {
579579 )
580580 }
581581
582+ pragma [ nomagic]
583+ private StringComponentImpl getComponentImplRestricted ( int n ) {
584+ result = this .getComponentImpl ( n ) and
585+ strictsum ( int length , int i | length = this .getComponentImpl ( i ) .getValue ( ) .length ( ) | length ) <
586+ 10000
587+ }
588+
582589 // 0 components results in the empty string
583- // if all interpolations have a known string value, we will get a result
584- language [ monotonicAggregates ]
590+ // if all interpolations have a known string value, we will get a result, unless the
591+ // combined length exceeds 10,000 characters
585592 final string getStringValue ( ) {
593+ not exists ( this .getComponentImpl ( _) ) and
594+ result = ""
595+ or
586596 result =
587- concat ( StringComponentImpl c , int i | c = this .getComponentImpl ( i ) | c .getValue ( ) order by i )
597+ strictconcat ( StringComponentImpl c , int i |
598+ c = this .getComponentImplRestricted ( i )
599+ |
600+ c .getValue ( ) order by i
601+ )
588602 }
589603}
590604
You can’t perform that action at this time.
0 commit comments