Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH 02/17: Don't crash when writing out history if HOST is unset
- X-seq: zsh-workers 34118
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH 02/17: Don't crash when writing out history if HOST is unset
- Date: Tue, 6 Jan 2015 06:25:34 +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=bvmLK5BdEAWBI8wL1dXcbKmOtmIo48qswkRywF6ubAI=; b=DoZ9x6DnAJEwcorPHfPHAECmKJM3GPW0ydaXZ5g/z8rM5P7RDpPm7Yl19ruomuV6ua bHg782LQAx1hcrpd4XaxxJTutenVdPlyBLq8BezX72HR7vkeRo3MEjLAxBXTvZT8lWV4 3qAFythpQOuauvSW8G+173nyvcFAWh8SHW/rq7rQj6L+NdUnBU1OKjpiWqz8wj1INp2r m4uk9VyWJY3fiuoo/QqVIH+A0nDNdosev/ULlFTxJ59PzrBvhmJxKKYlc6a1ro/iBvZA NX9IZP2nSGvw2UPwXRWxJjgDmXkVOBvi8N5HZ1SIo+zyhRHHxOpXfDDmX9WTx33rj3H1 R3UA==
- 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>
Found by Coverity (Issue 1255793).
---
Src/hist.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Src/hist.c b/Src/hist.c
index a006170..8ff9eff 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -2801,7 +2801,8 @@ lockhistfile(char *fn, int keep_trying)
#ifdef HAVE_LINK
# ifdef HAVE_SYMLINK
sprintf(pidbuf, "/pid-%ld/host-", (long)mypid);
- lnk = bicat(pidbuf, getsparam("HOST"));
+ lnk = getsparam("HOST");
+ lnk = bicat(pidbuf, lnk ? lnk : "");
/* We'll abuse fd as our success flag. */
while ((fd = symlink(lnk, lockfile)) < 0) {
if (errno != EEXIST) {
--
2.2.0.GIT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author