Browse Source

add an extra option check for tuple parsing

Felix 15 years ago
parent
commit
8500c9b016
1 changed files with 5 additions and 0 deletions
  1. 5 0
      util.c

+ 5 - 0
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;