about summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2015-01-05 14:46:25 +0100
committerMikael Magnusson <mikachu@gmail.com>2015-01-06 23:45:51 +0100
commitc9353814799ae399ccddaf0d48d224ce9cd52b67 (patch)
tree973a196820d62c94648299ecb4a9db063f747188 /Src/Zle/computil.c
parent6b79f29fb230e839c97682f9c8648cac2762669e (diff)
downloadzsh-c9353814799ae399ccddaf0d48d224ce9cd52b67.tar.gz
zsh-c9353814799ae399ccddaf0d48d224ce9cd52b67.tar.xz
zsh-c9353814799ae399ccddaf0d48d224ce9cd52b67.zip
34116: computil: Check for NULL before passing to strlen
The rest of this function appears to be very careful about checking these,
then forgets in this one spot. Found by Coverity (Issue 1255805).
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index b11c39f25..a81d1ddad 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -4060,7 +4060,8 @@ cfp_test_exact(LinkList names, char **accept, char *skipped)
     if (sl > PATH_MAX2)
 	return NULL;
 
-    suf = dyncat(skipped, rembslash(dyncat(compprefix, compsuffix)));
+    suf = dyncat(skipped, rembslash(dyncat(compprefix ? compprefix : "",
+		                           compsuffix ? compsuffix : "")));
 
     for (node = firstnode(names); node; incnode(node)) {
 	l = strlen(p = (char *) getdata(node));