fix a bug in blobmsg_parse
authorFelix Fietkau <nbd@openwrt.org>
Wed, 17 Aug 2011 17:44:11 +0000 (10:44 -0700)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 17 Aug 2011 17:44:11 +0000 (10:44 -0700)
a second entry that has the same length as an existing found entry would
abort the parse loop (reported by Stefan M├Ąchler)

blobmsg.c

index 15dc750..3079dca 100644 (file)
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -89,7 +89,7 @@ int blobmsg_parse(const struct blobmsg_policy *policy, int policy_len,
                                return -1;
 
                        if (tb[i])
                                return -1;
 
                        if (tb[i])
-                               return -1;
+                               continue;
 
                        if (strcmp(policy[i].name, (char *) hdr->name) != 0)
                                continue;
 
                        if (strcmp(policy[i].name, (char *) hdr->name) != 0)
                                continue;