Skip to content

Commit 68eba11

Browse files
authored
Update AccessOfMemoryLocationAfterEndOfBufferUsingStrncat.ql
1 parent aebf7bd commit 68eba11

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-788/AccessOfMemoryLocationAfterEndOfBufferUsingStrncat.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212

1313
import cpp
14-
import semmle.code.cpp.valuenumbering.HashCons
1514
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
1615

1716
/**
@@ -39,7 +38,7 @@ class WrongCallStrncat extends FunctionCall {
3938
*/
4039
predicate isExpressionEqualSizeof() {
4140
// the left side of the expression `someExpr` is `sizeof(buf)`.
42-
hashCons(this.getArgument(0)) = hashCons(leftsomeExpr.(SizeofExprOperator).getExprOperand())
41+
globalValueNumber(this.getArgument(0)) = globalValueNumber(leftsomeExpr.(SizeofExprOperator).getExprOperand())
4342
or
4443
// value of the left side of the expression `someExpr` equal `sizeof(buf)` value, and `buf` is array.
4544
leftsomeExpr.getValue().toInt() = this.getArgument(0).getType().getSize()

0 commit comments

Comments
 (0)