mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
C++: Replace minimum(any(...)) with a min aggregate. Also removed the min aggregate further down since it's no longer needed.
This commit is contained in:
@@ -101,7 +101,7 @@ class CallWithBufferSize extends FunctionCall {
|
||||
// result in this case we pick the minimum value obtainable from dataflow and range analysis.
|
||||
result =
|
||||
upperBound(statedSizeExpr())
|
||||
.minimum(any(Expr statedSizeSrc |
|
||||
.minimum(min(Expr statedSizeSrc |
|
||||
DataFlow::localExprFlow(statedSizeSrc, statedSizeExpr())
|
||||
|
|
||||
statedSizeSrc.getValue().toInt()
|
||||
@@ -112,7 +112,7 @@ class CallWithBufferSize extends FunctionCall {
|
||||
predicate wrongBufferSize(Expr error, string msg) {
|
||||
exists(CallWithBufferSize call, int bufsize, Variable buf, int statedSize |
|
||||
staticBuffer(call.buffer(), buf, bufsize) and
|
||||
statedSize = min(call.statedSizeValue()) and
|
||||
statedSize = call.statedSizeValue() and
|
||||
statedSize > bufsize and
|
||||
error = call.statedSizeExpr() and
|
||||
msg =
|
||||
|
||||
Reference in New Issue
Block a user