summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2024-07-25 10:06:34 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-07-25 12:57:05 +0200
commit7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9 (patch)
tree4a09de69884c2ef1e4326bcd9a617293fdf9aba5 /src
parentlogind-dbus: check auth. for all inhibitor operations (diff)
downloadsystemd-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.c3
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];