Skip to content

Commit 2b5d0a3

Browse files
committed
match functions that are similar to signal as well
1 parent 04cae50 commit 2b5d0a3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cpp/src/security/AsyncUnsafeSignalHandler/AsyncUnsafeSignalHandler.ql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ predicate isSignalHandlerField(FieldAccess fa) {
5050
fa.getTarget().getName() in ["__sa_handler", "__sa_sigaction", "sa_handler", "sa_sigaction"]
5151
}
5252

53-
5453
from FunctionCall fc, Function signalHandler, FieldAccess fa
5554
where
56-
fc.getTarget().getName() = "signal" and
55+
(
56+
fc.getTarget().getName().matches("%_signal") or
57+
fc.getTarget().getName() = "signal"
58+
) and
5759
signalHandler.getName() = fc.getArgument(1).toString() and
5860
isAsyncUnsafe(signalHandler)
5961
or
@@ -62,4 +64,4 @@ where
6264
signalHandler = fa.getTarget().getAnAssignedValue().(AddressOfExpr).getAddressable() and
6365
isAsyncUnsafe(signalHandler)
6466
select signalHandler,
65-
"is a non-trivial signal handler that may be using functions that are not async-safe."
67+
"is a non-trivial signal handler that may be using functions that are not async-safe."

0 commit comments

Comments
 (0)