mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-17 12:41:14 +02:00
34118: Don't crash when writing out history if HOST is unset
Found by Coverity (Issue 1255793).
This commit is contained in:
parent
a150563fb0
commit
6b79f29fb2
2 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
2015-01-06 Mikael Magnusson <mikachu@gmail.com>
|
||||
|
||||
* 34118: Src/hist.c: Don't crash when writing out history if
|
||||
HOST is unset
|
||||
|
||||
* 34114: Src/builtin.c: emulate: Handle aborting from mixed
|
||||
-L/-c correctly
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue