diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll index 0593ba85e70..287a677c5ef 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll @@ -588,6 +588,11 @@ newtype TContent = or // Arguments can overflow and end up in the starred parameter tuple. exists(any(CallNode cn).getArg(index)) + or + // since flow summaries might use tuples, we ensure that we at least have valid + // TTupleElementContent for the 0..7 (7 was picked to match `small_tuple` in + // data-flow-private) + index in [0 .. 7] } or /** An element of a dictionary under a specific key. */ TDictionaryElementContent(string key) { diff --git a/python/ql/test/experimental/dataflow/summaries-checks/invalid-spec.expected b/python/ql/test/experimental/dataflow/summaries-checks/invalid-spec.expected index bc342d8091a..e69de29bb2d 100644 --- a/python/ql/test/experimental/dataflow/summaries-checks/invalid-spec.expected +++ b/python/ql/test/experimental/dataflow/summaries-checks/invalid-spec.expected @@ -1,2 +0,0 @@ -| compiled re.subn | ReturnValue.TupleElement[0] | TupleElement[0] | -| re.subn | ReturnValue.TupleElement[0] | TupleElement[0] |