File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
ruby/ql/lib/codeql/ruby/ast/internal Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -579,12 +579,27 @@ 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
590+ // if all interpolations have a known string value, we will get a result, unless the
591+ // combined length exceeds 10,000 characters
584592 language [ monotonicAggregates]
585593 final string getStringValue ( ) {
594+ not exists ( this .getComponentImpl ( _) ) and
595+ result = ""
596+ or
586597 result =
587- concat ( StringComponentImpl c , int i | c = this .getComponentImpl ( i ) | c .getValue ( ) order by i )
598+ strictconcat ( StringComponentImpl c , int i |
599+ c = this .getComponentImplRestricted ( i )
600+ |
601+ c .getValue ( ) order by i
602+ )
588603 }
589604}
590605
You can’t perform that action at this time.
0 commit comments