]> pilppa.com Git - uci.git/commitdiff
fix sanity checks for uci.set to be able to create new sections
authorFelix Fietkau <nbd@openwrt.org>
Wed, 27 Aug 2008 14:45:56 +0000 (16:45 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 27 Aug 2008 14:45:56 +0000 (16:45 +0200)
lua/uci.c

index 7f4ba992e3cdf6cc3f2d45b1781049fb6e3d2f72..5891562116bb7c1bcc5c4c9bacd4b02efbdd463f 100644 (file)
--- a/lua/uci.c
+++ b/lua/uci.c
@@ -440,7 +440,7 @@ uci_lua_set(lua_State *L)
        if (err)
                goto error;
 
-       if ((ptr.s == NULL) || (ptr.value == NULL)) {
+       if (((ptr.s == NULL) && (ptr.option != NULL)) || (ptr.value == NULL)) {
                err = UCI_ERR_INVAL;
                goto error;
        }