We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2777ca4 commit faadcd9Copy full SHA for faadcd9
cpp/ql/src/Security/CWE/CWE-014/MemsetMayBeDeleted.ql
@@ -52,6 +52,10 @@ where
52
// Reference-typed variables get special treatment in `variableAddressEscapesTree` so we leave them
53
// out of this query.
54
not v.getUnspecifiedType() instanceof ReferenceType and
55
+ // `v` is not only just used in the call to `memset`.
56
+ exists(Access acc |
57
+ acc = v.getAnAccess() and not call.getArgument(0).getAChild*() = acc and not acc.isUnevaluated()
58
+ ) and
59
// There is no later use of `v`.
60
not v.getAnAccess() = call.getASuccessor*() and
61
// Not using the `-fno-builtin-memset` flag
0 commit comments