Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2018-07-25 11:30:05 +0300
committerJohn Crispin <john@phrozen.org>2018-07-25 11:30:05 +0300
commitc83a84afbef2b24f960ddeda0b5e2ab01fba6981 (patch)
tree8487605c8493ee29efac3ff61f63e0b20ca43f01 /blobmsg.c
parent3c1b33b7d57ad8b8aeeab8babd48625b86532e0b (diff)
fix segfault when passed blobmsg attr is NULL
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'blobmsg.c')
-rw-r--r--blobmsg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/blobmsg.c b/blobmsg.c
index c2bb717..8019c45 100644
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -135,6 +135,8 @@ int blobmsg_parse(const struct blobmsg_policy *policy, int policy_len,
int i;
memset(tb, 0, policy_len * sizeof(*tb));
+ if (!data || !len)
+ return -EINVAL;
pslen = alloca(policy_len);
for (i = 0; i < policy_len; i++) {
if (!policy[i].name)