Skip to content

Commit 0ff08cd

Browse files
committed
CPP: Be conservative where there are multiple flow sources.
1 parent 7a03350 commit 0ff08cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Critical/OverflowStatic.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class CallWithBufferSize extends FunctionCall
102102
predicate wrongBufferSize(Expr error, string msg) {
103103
exists(CallWithBufferSize call, int bufsize, Variable buf, int statedSize |
104104
staticBuffer(call.buffer(), buf, bufsize) and
105-
statedSize = call.statedSizeValue() and
105+
statedSize = min(call.statedSizeValue()) and
106106
statedSize > bufsize and
107107
error = call.statedSizeExpr() and
108108
msg = "Potential buffer-overflow: '" + buf.getName() +

0 commit comments

Comments
 (0)