Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH 03/17: computil: Check for NULL before passing to strlen
- X-seq: zsh-workers 34116
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH 03/17: computil: Check for NULL before passing to strlen
- Date: Tue, 6 Jan 2015 06:25:35 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=PzNRFgV2IOHhJVFrcNUo3LhnnQ7cAJKidPqS+af8s4c=; b=ELr22ixrdGr8638LTv8nLhMJ7pJeSX4pg7xSCJoJ1lLPmm0m7FczdWRTEL/+E7vkL3 KqByuBJjvR2oTrIQ52yPrsvSg6R34l43Z4y4zEIQnW5zEuwDigkFhGgV7Vrz3lHZ6ns7 +dy7J+p94SV7yjxlTzrLAWRGwicihSnUkNDi1ITG+ioP2AEyJy0KH0PlNmKw5To9YRtG s4+7HqufIqkEPiGhX2kOYgbEJfSifJ5EipzUhBiabDoNpar1aeHaHpJs8LolerVNWeut jju+lMPEU26TbRMKNueYOAKK1tIXi719OIlHz3/SCjyIFXnlcC0GITQCeiPYEGLJ2HVu qSlg==
- In-reply-to: <1420521949-30483-1-git-send-email-mikachu@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1420521949-30483-1-git-send-email-mikachu@gmail.com>
The rest of this function appears to be very careful about checking these,
then forgets in this one spot. Found by Coverity (Issue 1255805).
---
Src/Zle/computil.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index b11c39f..a81d1dd 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));
--
2.2.0.GIT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author