Skip to content

Commit 57fe4b9

Browse files
committed
C++: Also fix variableMustBeNullTerminated.
1 parent b4b8392 commit 57fe4b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/ql/lib/semmle/code/cpp/commons/NullTermination.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ predicate variableMustBeNullTerminated(VariableAccess va) {
120120
// Simplified: check that `p` may not be null terminated on *any*
121121
// path to `use` (including the one found via `parameterUsePair`)
122122
not exists(Expr e, BasicBlock bb1, int pos1, BasicBlock bb2, int pos2 |
123-
mayAddNullTerminator(e, p.getAnAccess()) and
124-
bb1.getNode(pos1) = e and
123+
mayAddNullTerminator(pragma[only_bind_into](e), p.getAnAccess()) and
124+
pragma[only_bind_into](bb1).getNode(pos1) = e and
125125
bb2.getNode(pos2) = use
126126
|
127127
bb1 = bb2 and pos1 < pos2

0 commit comments

Comments
 (0)