Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Crash if $TMPPREFIX has invalid or read-only path
- X-seq: zsh-workers 52125
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] Crash if $TMPPREFIX has invalid or read-only path
- Date: Sun, 10 Sep 2023 20:38:27 -0700
- Archived-at: <https://zsh.org/workers/52125>
- List-id: <zsh-workers.zsh.org>
Easily seen with
zsh -fc 'TMPPREFIX=/tmp/xxx/zsh; echo =(<<<"")'
getoutputfile() calls free() on memory that was allocated on the heap
by gettempname().
diff --git a/Src/exec.c b/Src/exec.c
index 8f9d5a885..3a8b3e951 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4897,7 +4897,6 @@ getoutputfile(char *cmd, char **eptr)
if ((fd = open(nam, O_WRONLY | O_CREAT | O_EXCL | O_NOCTTY, 0600)) < 0) {
zerr("process substitution failed: %e", errno);
- free(nam);
if (!s)
child_unblock();
return NULL;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author