Skip to content

Commit a4898ab

Browse files
committed
C++: Restrict a default taint step to only add flow from the index to the result. Previously, it would add spurious flow from the base to the result as well.
1 parent 17ab87d commit a4898ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private module Cached {
5858
// indirection of the pointer arithmetic instruction. This provides flow from `source`
5959
// in `x[source]` to the result of the associated load instruction.
6060
exists(PointerArithmeticInstruction pai, int indirectionIndex |
61-
nodeHasOperand(nodeFrom, pai.getAnOperand(), pragma[only_bind_into](indirectionIndex)) and
61+
nodeHasOperand(nodeFrom, pai.getRightOperand(), pragma[only_bind_into](indirectionIndex)) and
6262
hasInstructionAndIndex(nodeTo, pai, indirectionIndex + 1)
6363
) and
6464
model = ""

0 commit comments

Comments
 (0)