Skip to content

Commit aceeb73

Browse files
committed
restrict AST nodes according to string length
1 parent 864b61a commit aceeb73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FunctionBodyFeatures.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ pragma[inline]
3838
ASTNode getAnASTNodeToFeaturize(Function f) {
3939
result.getParent*() = f and
4040
// Don't featurize the function name as part of the function body tokens
41-
not result = f.getIdentifier()
41+
not result = f.getIdentifier() and
42+
// Don't include nodes with names that are too long (to avoid catastrophic error due to tokenized strings getting too long)
43+
result.toString().length() < 500000
4244
}
4345

4446
/**

0 commit comments

Comments
 (0)