File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -574,7 +574,7 @@ module StringOps {
574574 not exists ( getStringValue ( ) ) and
575575 result =
576576 strictconcat ( StringLiteralLike leaf |
577- leaf = getALeaf ( ) .asExpr ( )
577+ leaf = this . ( SmallConcatenationRoot ) . getALeaf ( ) .asExpr ( )
578578 |
579579 leaf .getStringValue ( )
580580 order by
@@ -583,6 +583,17 @@ module StringOps {
583583 }
584584 }
585585
586+ /**
587+ * A concatenation root where the combined length of the constant parts
588+ * is less than 1 million chars.
589+ */
590+ private class SmallConcatenationRoot extends ConcatenationRoot {
591+ SmallConcatenationRoot ( ) {
592+ sum ( StringLiteralLike leaf | leaf = getALeaf ( ) .asExpr ( ) | leaf .getStringValue ( ) .length ( ) ) <
593+ 1000 * 1000
594+ }
595+ }
596+
586597 /** A string literal or template literal without any substitutions. */
587598 private class StringLiteralLike extends Expr {
588599 StringLiteralLike ( ) {
You can’t perform that action at this time.
0 commit comments