Skip to content

Commit 418adb8

Browse files
authored
Update FindIncorrectlyUsedExceptions.ql
1 parent fd73f40 commit 418adb8

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-703/FindIncorrectlyUsedExceptions.ql

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ where
3838
fc.getTargetType().(Class).getABaseClass+().hasGlobalOrStdName("exception") or
3939
fc.getTargetType().(Class).getABaseClass+().hasGlobalOrStdName("CException")
4040
) and
41-
not fc.isInMacroExpansion() and
42-
not exists(ThrowExpr texp | fc.getEnclosingStmt() = texp.getEnclosingStmt()) and
43-
not exists(FunctionCall fctmp | fctmp.getAnArgument() = fc) and
44-
not fc instanceof ConstructorDirectInit and
45-
not fc.getEnclosingStmt() instanceof DeclStmt and
46-
not fc instanceof ConstructorDelegationInit and
47-
not fc.getParent() instanceof Initializer and
48-
not fc.getParent() instanceof AllocationExpr and
49-
not fc.getEnclosingStmt() instanceof ReturnStmt and
41+
fc instanceof ExprInVoidContext and
5042
msg = "This object does not generate an exception."
5143
select fc, msg

0 commit comments

Comments
 (0)