system: fix arguments validation in ubus handler
authorKartashov Alexey <ya.antixrist@gmail.com>
Thu, 9 Oct 2025 06:55:35 +0000 (10:55 +0400)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 9 Feb 2026 10:59:14 +0000 (10:59 +0000)
Fix arguments validation (broken access to blob_attr property)

Fixes: 03aab02 ("add a ubus handler that allows sending signals to processes")
Signed-off-by: Kartashov Alexey <ya.antixrist@gmail.com>
[improved commit message]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
system.c

index 7a4c24d84362f459f4fb4e931a4b88d60a28ba92..f6fe444676ed94027d274edb4d0f289fd71a63af 100644 (file)
--- a/system.c
+++ b/system.c
@@ -538,7 +538,7 @@ static int proc_signal(struct ubus_context *ctx, struct ubus_object *obj,
                return UBUS_STATUS_INVALID_ARGUMENT;
 
        blobmsg_parse(signal_policy, __SIGNAL_MAX, tb, blob_data(msg), blob_len(msg));
-       if (!tb[SIGNAL_PID || !tb[SIGNAL_NUM]])
+       if (!tb[SIGNAL_PID] || !tb[SIGNAL_NUM])
                return UBUS_STATUS_INVALID_ARGUMENT;
 
        kill(blobmsg_get_u32(tb[SIGNAL_PID]), blobmsg_get_u32(tb[SIGNAL_NUM]));