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 {
579
579
)
580
580
}
581
581
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
+
582
589
// 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
584
592
language [ monotonicAggregates]
585
593
final string getStringValue ( ) {
594
+ not exists ( this .getComponentImpl ( _) ) and
595
+ result = ""
596
+ or
586
597
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
+ )
588
603
}
589
604
}
590
605
You can’t perform that action at this time.
0 commit comments