mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Addressing false positive with strncpy.
This commit is contained in:
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user