From 9cf978bc79641691f0c603c71fcfa98c1626ce59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 5 Nov 2019 00:39:46 +0100 Subject: delta: prevent possible null pointer use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scan-build from clang version 9 has reported following issue: delta.c:39:13: warning: Null pointer passed to 1st parameter expecting 'nonnull' int size = strlen(section) + 1; ^~~~~~~~~~~~~~~ Signed-off-by: Petr Štetiar --- delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'delta.c') diff --git a/delta.c b/delta.c index a131e3a..d8bd3a6 100644 --- a/delta.c +++ b/delta.c @@ -392,7 +392,7 @@ static void uci_filter_delta(struct uci_context *ctx, const char *name, const ch match = false; } - if (!match) { + if (!match && ptr.section) { uci_add_delta(ctx, &list, c, ptr.section, ptr.option, ptr.value); } -- cgit v1.2.1