mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02: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."
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
| errors.c:10:5:10:12 | call to swprintf | This 'call to swprintf' operation is limited to 12 bytes but the destination is only 3 bytes. |
|
||||
| tests.c:43:3:43:10 | call to snprintf | This 'call to snprintf' operation is limited to 111 bytes but the destination is only 110 bytes. |
|
||||
| tests.c:46:3:46:10 | call to snprintf | This 'call to snprintf' operation is limited to 111 bytes but the destination is only 110 bytes. |
|
||||
|
||||
Reference in New Issue
Block a user