projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hotplug: add extra validation for commands
[project/procd.git]
/
hotplug-rule.c
diff --git
a/hotplug-rule.c
b/hotplug-rule.c
index
7e9c16a
..
b157fcd
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;
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;
ret = __rule_process_type(cur, msg, cmd, ARRAY_SIZE(cmd), &found);
if (found)
return ret;