From 2fcc6d756f23b439d24eb061ccd0a815a5626f69 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 29 Sep 2013 13:20:34 +0200 Subject: [PATCH] uci_delete: check ptr->o and its type before checking ptr->value Signed-off-by: Felix Fietkau --- list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list.c b/list.c index e6ef1c1..0ea7eda 100644 --- a/list.c +++ b/list.c @@ -560,7 +560,7 @@ int uci_delete(struct uci_context *ctx, struct uci_ptr *ptr) UCI_ASSERT(ctx, ptr->s); - if (ptr->value && *ptr->value && ptr->o && ptr->o->type == UCI_TYPE_LIST) { + if (ptr->o && ptr->o->type == UCI_TYPE_LIST && ptr->value && *ptr->value) { if (!sscanf(ptr->value, "%d", &index)) return 1; -- 2.30.2