diff options
author | Felix <nbd@openwrt.org> | 2008-08-26 01:20:43 +0200 |
---|---|---|
committer | Felix <nbd@openwrt.org> | 2008-08-26 01:20:43 +0200 |
commit | 8500c9b01699a94c0516ee5cbc10e8c0fb7b0408 (patch) | |
tree | efe0e7eeacc84a2d023e7b825a93b1411b37c1f4 | |
parent | 179b6f5fced8a0c1028ee56451efa26e40392961 (diff) | |
download | uci-8500c9b01699a94c0516ee5cbc10e8c0fb7b0408.tar.gz |
add an extra option check for tuple parsing
-rw-r--r-- | util.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -120,6 +120,7 @@ static void uci_alloc_parse_context(struct uci_context *ctx) int uci_parse_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str) { char *last = NULL; + char *tmp; UCI_HANDLE_ERR(ctx); UCI_ASSERT(ctx, str); @@ -153,6 +154,10 @@ int uci_parse_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str) ptr->target = UCI_TYPE_OPTION; } + tmp = strsep(&str, "."); + if (tmp) + goto error; + lastval: if (ptr->package && !uci_validate_str(ptr->package, false)) goto error; |