diff --git a/ql/src/semmle/go/security/AllocationSizeOverflowCustomizations.qll b/ql/src/semmle/go/security/AllocationSizeOverflowCustomizations.qll index 1b7bd4bfdb9..f99851a3504 100644 --- a/ql/src/semmle/go/security/AllocationSizeOverflowCustomizations.qll +++ b/ql/src/semmle/go/security/AllocationSizeOverflowCustomizations.qll @@ -75,7 +75,7 @@ module AllocationSizeOverflow { /** A check of the allocation size, acting as a guard to prevent allocation-size overflow. */ class AllocationSizeCheck extends DataFlow::BarrierGuard, DataFlow::RelationalComparisonNode { override predicate checks(Expr e, boolean branch) { - exists(DataFlow::Node lesser | this.leq(branch, lesser, _, _) | + exists(DataFlow::Node lesser | this.leq(branch, lesser, _, _) and not lesser.isConst() | globalValueNumber(DataFlow::exprNode(e)) = globalValueNumber(lesser) ) }