Skip to content

Commit 65c9a7b

Browse files
authored
Update BufferAccessWithIncorrectLengthValue.ql
1 parent c1f0940 commit 65c9a7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ where
6565
exists(ArrayType array, int bufArgPos, int sizeArgPos |
6666
numberArgument(fc.getTarget(), bufArgPos, sizeArgPos) and
6767
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
68+
fc.getArgument(pragma[only_bind_into](bufArgPos))
69+
.(VariableAccess)
70+
.getTarget()
71+
.getADeclarationEntry()
72+
.getType() = array
6973
)
7074
select fc,
7175
"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)