aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2020-01-23 18:09:51 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2020-01-26 22:20:29 +0000
commit862fb68b0a1e60449ac6d977727c7e2b4f069c99 (patch)
tree0fcbed6c485cea2d676f992d37ecbbb45d014d99
parent65353dce81a629e042800bb7b86fcd869a76727e (diff)
Fix globset compilation warningicefish_8.99.5icefish/8.99.58.99.5
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
-rw-r--r--src/globset.c11
1 files changed, 3 insertions, 8 deletions
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
*