Addressing false positive with strncpy.

This commit is contained in:
REDMOND\brodes
2024-08-08 15:08:53 -04:00
parent 9105375097
commit abd0a076a8
3 changed files with 25 additions and 17 deletions

View File

@@ -125,10 +125,11 @@ class StrncpyBA extends BufferAccess {
result = this.(FunctionCall).getArgument(0) and
bufferDesc = "destination buffer" and
accessType = 2
or
result = this.(FunctionCall).getArgument(1) and
bufferDesc = "source buffer" and
accessType = 2
// Ignore this case as reading past the source null terminator is not the behavior of strncpy
// or
// result = this.(FunctionCall).getArgument(1) and
// bufferDesc = "source buffer" and
// accessType = 2
}
override Expr getSizeExpr() { result = this.(FunctionCall).getArgument(2) }