Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/ql/src/Security/CWE/CWE-120/BadlyBoundedWrite.ql
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ from BufferWrite bw, int destSize
where bw.hasExplicitLimit() // has an explicit size limit
and destSize = getBufferSize(bw.getDest(), _)
and (bw.getExplicitLimit() > destSize) // but it's larger than the destination
and not destSize = 0 // probably a variable-size member if the destination size is 0
select bw, "This '" + bw.getBWDesc() + "' operation is limited to " + bw.getExplicitLimit() + " bytes but the destination is only " + destSize + " bytes."