summaryrefslogtreecommitdiffstats
path: root/hotplug-rule.c
diff options
context:
space:
mode:
Diffstat (limited to 'hotplug-rule.c')
-rw-r--r--hotplug-rule.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hotplug-rule.c b/hotplug-rule.c
index 7e9c16a..b157fcd 100644
--- 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;