mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Update cpp/ql/src/experimental/Security/CWE/CWE-805/BufferAccessWithIncorrectLengthValue.ql
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
This commit is contained in:
@@ -64,8 +64,8 @@ from FunctionCall fc
|
|||||||
where
|
where
|
||||||
exists(ArrayType array, int bufArgPos, int sizeArgPos |
|
exists(ArrayType array, int bufArgPos, int sizeArgPos |
|
||||||
numberArgument(fc.getTarget(), bufArgPos, sizeArgPos) and
|
numberArgument(fc.getTarget(), bufArgPos, sizeArgPos) and
|
||||||
fc.getArgument(sizeArgPos).getValue().toInt() > array.getByteSize() and
|
fc.getArgument(pragma[only_bind_into](sizeArgPos)).getValue().toInt() > array.getByteSize() and
|
||||||
fc.getArgument(bufArgPos).(VariableAccess).getTarget().getADeclarationEntry().getType() = array
|
fc.getArgument(pragma[only_bind_into](bufArgPos)).(VariableAccess).getTarget().getADeclarationEntry().getType() = array
|
||||||
)
|
)
|
||||||
select fc,
|
select fc,
|
||||||
"Access beyond the bounds of the allocated memory is possible, the size argument used is greater than the size of the buffer."
|
"Access beyond the bounds of the allocated memory is possible, the size argument used is greater than the size of the buffer."
|
||||||
|
|||||||
Reference in New Issue
Block a user