diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-13 12:28:37 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-13 12:29:01 +0100 |
commit | 1d2b3bbdbefa4901e34506f86f4b4c4412dbb555 (patch) | |
tree | a20cd5fd8cadae962e5c2a15c1a2228859a0f04c | |
parent | 85e4de419362dcf831539d63c06a88015a582785 (diff) | |
download | ubus-1d2b3bbdbefa4901e34506f86f4b4c4412dbb555.tar.gz |
ubusd: add missing NULL pointer checks for ACL processing
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | ubusd_acl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ubusd_acl.c b/ubusd_acl.c index eb5cec5..15a58d8 100644 --- a/ubusd_acl.c +++ b/ubusd_acl.c @@ -105,6 +105,9 @@ ubusd_acl_check(struct ubus_client *cl, const char *obj, return 0; acl = avl_find_ge_element(&ubusd_acls, obj, acl, avl); + if (!acl) + return -1; + avl_for_element_to_last(&ubusd_acls, acl, acl, avl) { int diff = ubusd_acl_match_path(obj, acl->avl.key, NULL); @@ -415,6 +418,9 @@ ubusd_reply_add(struct ubus_object *obj) return; acl = avl_find_ge_element(&ubusd_acls, obj->path.key, acl, avl); + if (!acl) + return; + avl_for_element_to_last(&ubusd_acls, acl, acl, avl) { void *c; |