projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
859c089
)
hotplug: add extra validation for commands
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 13 Feb 2013 16:11:30 +0000
(17:11 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 13 Feb 2013 16:11:32 +0000
(17:11 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
hotplug-rule.c
patch
|
blob
|
history
diff --git
a/hotplug-rule.c
b/hotplug-rule.c
index 7e9c16adff7c25dd1f6a9f8bebddbdd9e58a1e64..b157fcd19bca926ec11a7215eaaa394afa3397b8 100644
(file)
--- a/
hotplug-rule.c
+++ b/
hotplug-rule.c
@@
-399,6
+399,12
@@
static int __rule_process_cmd(struct blob_attr *cur, struct blob_attr *msg)
bool found;
int ret;
+ if (blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY ||
+ blobmsg_type(blobmsg_data(cur)) != BLOBMSG_TYPE_STRING) {
+ rule_error(cur, "Unexpected element type");
+ return -1;
+ }
+
ret = __rule_process_type(cur, msg, cmd, ARRAY_SIZE(cmd), &found);
if (found)
return ret;