summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKartashov Alexey2025-10-09 06:55:35 +0000
committerDaniel Golle2026-03-14 00:29:08 +0000
commit1f2aa1a78486ad693e031d32773898a0427b578f (patch)
treeab91d4ff2ec0ccf86771902283c57824e74da9ba
parent7e5e0491d6366445accb542cf35d15999fdae35e (diff)
system: fix arguments validation in ubus handler
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> (cherry picked from commit bafdfff100d3bf1e91d35664b97cfd101d564416)
-rw-r--r--system.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/system.c b/system.c
index 9c8d3dc..5ce9d27 100644
--- a/system.c
+++ b/system.c
@@ -536,7 +536,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]));