Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: hist: remove wrong NULL terminator
- X-seq: zsh-workers 34178
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: hist: remove wrong NULL terminator
- Date: Fri, 9 Jan 2015 13:43:39 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=OG+wEHI5T2G6F1F73PIHoOhPCS+6+xFKCHviUVacqG8=; b=ADYgHwdHOKcD9Qyv1/Kw/h+ZOrxm7IewqCcHFFa4H69Dj1hgi4gzC5QmJwexfKTDl0 iZ3Zb6K4z83Pt4igwOTX+g2fc5N+JMAfhZ0VSxQ9xeW0cpIYR571jNHWfwAY+WQBue37 NXofpiWUYmbwZbiCLaVeamwxuRdycOlYybzqWVnpTrVAzDB30Wx017qT/d/R9aam1Xx4 cDWsd3okoCPPIQlrnoYTDpCzN+DtO/Bx5BE0r6LEqaSnyv2b/IuQs+FOfku8D8WWCEwy vf+8S7IFCEQOL718C/FfkCKjD5mf81Od5Bz7EW+1wP5I5zUF5AIqndVvBleOZ1+yywXq zfdQ==
- 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
This actually writes a NULL to some arbitrary location in the caller function's stack. Found by Coverity (Issue 1255746).
The start of the quote() function does char **str = tr; and is called like this,
quote(&sline);
sline in turn is just a char *sline;
The result of str[1] = NULL; is then, as far as I can tell, not anything good. I also can't see any other thing that might have been intended to be NULL-terminated here, so just remove it.
---
Src/hist.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/Src/hist.c b/Src/hist.c
index e65d78b..3dc0472 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -2179,7 +2179,6 @@ quote(char **tr)
*rptr++ = *ptr;
*rptr++ = '\'';
*rptr++ = 0;
- str[1] = NULL;
return 0;
}
--
2.2.0.GIT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author