diff options
author | David Tardon <dtardon@redhat.com> | 2024-07-25 10:06:34 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-07-25 12:57:05 +0200 |
commit | 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9 (patch) | |
tree | 4a09de69884c2ef1e4326bcd9a617293fdf9aba5 /src | |
parent | logind-dbus: check auth. for all inhibitor operations (diff) | |
download | systemd-7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9.tar.xz systemd-7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd/sd-event/sd-event.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index f1aed5de60..a593d0e50d 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -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]; |