Skip to content

Commit 229250d

Browse files
committed
Python: Limit size of TupleElementContent
A more principled approach is possible here, but in the short term this will prevent an explosion. For reference, openstack/cinder has roughly 19000 `ForTarget`s and tuples of size up to 5300, and we were calculating the cartesian product of these.
1 parent dbef36c commit 229250d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ predicate forReadStep(CfgNode nodeFrom, Content c, Node nodeTo) {
15171517
or
15181518
c instanceof SetElementContent
15191519
or
1520-
c instanceof TupleElementContent
1520+
c.(TupleElementContent).getIndex() <= 7
15211521
)
15221522
}
15231523

0 commit comments

Comments
 (0)