Skip to content

Commit c1f0940

Browse files
ihsinmejketema
andauthored
Update cpp/ql/src/experimental/Security/CWE/CWE-805/BufferAccessWithIncorrectLengthValue.ql
Co-authored-by: Jeroen Ketema <[email protected]>
1 parent 5609d52 commit c1f0940

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-805/BufferAccessWithIncorrectLengthValue.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ from FunctionCall fc
6464
where
6565
exists(ArrayType array, int bufArgPos, int sizeArgPos |
6666
numberArgument(fc.getTarget(), bufArgPos, sizeArgPos) and
67-
fc.getArgument(sizeArgPos).getValue().toInt() > array.getByteSize() and
68-
fc.getArgument(bufArgPos).(VariableAccess).getTarget().getADeclarationEntry().getType() = array
67+
fc.getArgument(pragma[only_bind_into](sizeArgPos)).getValue().toInt() > array.getByteSize() and
68+
fc.getArgument(pragma[only_bind_into](bufArgPos)).(VariableAccess).getTarget().getADeclarationEntry().getType() = array
6969
)
7070
select fc,
7171
"Access beyond the bounds of the allocated memory is possible, the size argument used is greater than the size of the buffer."

0 commit comments

Comments
 (0)