diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2015-01-05 14:46:25 +0100 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2015-01-06 23:45:51 +0100 |
commit | c9353814799ae399ccddaf0d48d224ce9cd52b67 (patch) | |
tree | 973a196820d62c94648299ecb4a9db063f747188 /Src/Zle/computil.c | |
parent | 6b79f29fb230e839c97682f9c8648cac2762669e (diff) | |
download | zsh-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.c | 3 |
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)); |