diff options
author | John Crispin <john@phrozen.org> | 2018-07-25 11:30:05 +0300 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-07-25 11:30:05 +0300 |
commit | c83a84afbef2b24f960ddeda0b5e2ab01fba6981 (patch) | |
tree | 8487605c8493ee29efac3ff61f63e0b20ca43f01 /blobmsg.c | |
parent | 3c1b33b7d57ad8b8aeeab8babd48625b86532e0b (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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) |