From: José Bollo <jose.bollo@iot.bzh>
Date: Thu, 23 Jan 2020 17:09:51 +0000 (+0100)
Subject: Fix globset compilation warning
X-Git-Tag: 8.99.5^0
X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F23648%2F3;p=src%2Fapp-framework-binder.git

Fix globset compilation warning

The case of returning NULL is not tested in `globset_add`.
It is safe because `grow` is called first and then `search`
never returns a NULL pointer.

Bug-AGL: SPEC-3134

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: I21e8ba3a6c8202a920c6784f4d61376450b9a063
---

diff --git a/src/globset.c b/src/globset.c
index 124ff246..5ffdfa20 100644
--- a/src/globset.c
+++ b/src/globset.c
@@ -227,21 +227,16 @@ static struct pathndl *search(
 		pph = &set->globs;
 	else if (set->exacts)
 		pph = &set->exacts[hash & set->gmask];
-	else
+	else {
+		*pprev = NULL;
 		return NULL;
+	}
 	while ((ph = *pph) && strcmp(normal, ph->handler.pattern))
 		pph = &ph->next;
 	*pprev = pph;
 	return ph;
 }
 
-
-
-
-
-
-
-
 /**
  * Allocates a new set of handlers
  *