sd-event: do not assert on invalid signal

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.
This commit is contained in:
David Tardon 2024-07-25 10:06:34 +02:00 committed by Luca Boccassi
parent 639719e010
commit 7a64c5f23e

View File

@ -3871,7 +3871,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];