Skip to content

Commit ffc27b5

Browse files
committed
Python: Solve problems with missing TTupleElementContent
Ruby uses 10 as their number. I considered doing the same, but didn't really care _too_ much about it 🤷 https://github.com/github/codeql/blob/14cfb82a8c16e15fadc006ae46331302f0341f63/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll#L636
1 parent c3fa3f2 commit ffc27b5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,11 @@ newtype TContent =
588588
or
589589
// Arguments can overflow and end up in the starred parameter tuple.
590590
exists(any(CallNode cn).getArg(index))
591+
or
592+
// since flow summaries might use tuples, we ensure that we at least have valid
593+
// TTupleElementContent for the 0..7 (7 was picked to match `small_tuple` in
594+
// data-flow-private)
595+
index in [0 .. 7]
591596
} or
592597
/** An element of a dictionary under a specific key. */
593598
TDictionaryElementContent(string key) {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
| compiled re.subn | ReturnValue.TupleElement[0] | TupleElement[0] |
2-
| re.subn | ReturnValue.TupleElement[0] | TupleElement[0] |

0 commit comments

Comments
 (0)