Skip to content

Commit

Permalink
sd-event: do not assert on invalid signal
Browse files Browse the repository at this point in the history
The signalfd_siginfo struct is received from outside via a FD, hence
assert() is not appropriate way to check it. Just do a normal runtime
check.

(cherry picked from commit 7a64c5f)

Resolves: RHEL-51171
  • Loading branch information
dtardon authored and lnykryn committed Jul 30, 2024
1 parent 571c902 commit 07539d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libsystemd/sd-event/sd-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -3866,7 +3866,8 @@ static int process_signal(sd_event *e, struct signal_data *d, uint32_t events, i
if (_unlikely_(n != sizeof(si)))
return -EIO;

assert(SIGNAL_VALID(si.ssi_signo));
if (_unlikely_(!SIGNAL_VALID(si.ssi_signo)))
return -EINVAL;

if (e->signal_sources)
s = e->signal_sources[si.ssi_signo];
Expand Down

0 comments on commit 07539d2

Please sign in to comment.