Skip to content

Commit a2b8eb9

Browse files
committed
C++: Remove the '+ 1' in 'getAFlowStateForNode'.
1 parent 1455e8b commit a2b8eb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/AllocationToInvalidPointer.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private module SizeBarrier {
123123
private int getAFlowStateForNode(DataFlow::Node node) {
124124
exists(DataFlow::Node source |
125125
flow(source, node) and
126-
hasSize(_, source, result + 1)
126+
hasSize(_, source, result)
127127
)
128128
}
129129

@@ -155,7 +155,7 @@ private module SizeBarrier {
155155
pragma[only_bind_into](k), pragma[only_bind_into](edge)) and
156156
bounded(result, value.getAnInstruction(), delta) and
157157
g.controls(result.getBlock(), edge) and
158-
k <= getAFlowStateForNode(right)
158+
k < getAFlowStateForNode(right)
159159
)
160160
}
161161

0 commit comments

Comments
 (0)