From 8500c9b01699a94c0516ee5cbc10e8c0fb7b0408 Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 26 Aug 2008 01:20:43 +0200 Subject: [PATCH] add an extra option check for tuple parsing --- util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util.c b/util.c index d5bcd8a..7f37e88 100644 --- a/util.c +++ b/util.c @@ -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; -- 2.25.1