mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +01:00
C++: Remove FPs from cpp/badly-bounded-write
This commit is contained in:
@@ -25,7 +25,8 @@ from BufferWrite bw, int destSize
|
||||
where
|
||||
bw.hasExplicitLimit() and // has an explicit size limit
|
||||
destSize = max(getBufferSize(bw.getDest(), _)) and
|
||||
bw.getExplicitLimit() > destSize // but it's larger than the destination
|
||||
bw.getExplicitLimit() > destSize and // but it's larger than the destination
|
||||
not bw.getDest().getUnderlyingType().stripType() instanceof ErroneousType // destSize may be incorrect
|
||||
select bw,
|
||||
"This '" + bw.getBWDesc() + "' operation is limited to " + bw.getExplicitLimit() +
|
||||
" bytes but the destination is only " + destSize + " bytes."
|
||||
|
||||
Reference in New Issue
Block a user