Skip to content

Commit 9907f0f

Browse files
committed
C++: Exclude a cast to any integral type.
1 parent 4b02f88 commit 9907f0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/ql/src/Security/CWE/CWE-416/UseOfUniquePointerAfterLifetimeEnds.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ where
3030
outlivesFullExpr(c) and
3131
not c.isFromUninstantiatedTemplate(_) and
3232
isUniquePointerDerefFunction(c.getTarget()) and
33-
not c.getActualType() instanceof BoolType and
33+
// Exclude cases where the pointer is implicitly converted to a non-pointer type
34+
not c.getActualType() instanceof IntegralType and
3435
isTemporary(c.getQualifier().getFullyConverted())
3536
select c,
3637
"The underlying unique pointer object is destroyed after the call to '" + c.getTarget() +

0 commit comments

Comments
 (0)