summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-02-13 17:09:37 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-02-13 17:09:44 +0100
commit859c08948968051330b5daddc07d62b40eca23a7 (patch)
tree2124369938ecde27ef1770864d0808029190a017
parent144991354372ae010c84ec7d9efecb03ad3fae74 (diff)
downloadunitd-859c08948968051330b5daddc07d62b40eca23a7.tar
unitd-859c08948968051330b5daddc07d62b40eca23a7.zip
hotplug: validate expression name element
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--hotplug-rule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hotplug-rule.c b/hotplug-rule.c
index 7508b1d..7e9c16a 100644
--- a/hotplug-rule.c
+++ b/hotplug-rule.c
@@ -306,7 +306,8 @@ static int rule_process_expr(struct blob_attr *cur, struct blob_attr *msg)
bool found;
int ret;
- if (blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY) {
+ if (blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY ||
+ blobmsg_type(blobmsg_data(cur)) != BLOBMSG_TYPE_STRING) {
rule_error(cur, "Unexpected element type");
return -1;
}