Commit: 6cf9117bfd3f3b19cd6cfcf32910e29e57a4b1f7
Parent: c9fcea121f9ad8b9c36263ea6254158c8fa793c8
Author: Bastien Nocera <hadess@hadess.net>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-06-03 22:06:11
Tree: a6a79fe8951077f0cafab34e5a2cd0dd440229a6

shared/mainloop: Fix integer overflow signalfd_siginfo uses a u32 for the signal number, but siginfo_t uses a signed integer for it, so an (unlikely) big value for the signal number could result in a negative value being passed to the callbacks. Catch that and bail early. Error: INTEGER_OVERFLOW (CWE-190): [#def44] [important] src/shared/mainloop-notify.c:137:3: underflow: The cast of "si.ssi_signo" to a signed type could result in a negative number. 135| 136| if (data && data->func) 137|-> data->func(si.ssi_signo, data->user_data); 138| 139| return true;

Diffstat

M src/shared/mainloop-notify.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)

View Full Diff | Patch