summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/exec.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f03b1b4a..cf53b217e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-27  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 35634: Src/exec.c: handle failure of gettempname() in namedpipe()
+
 2015-06-27  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* users/20281: Completion/Base/Core/_main_complete:
diff --git a/Src/exec.c b/Src/exec.c
index 50a11eb54..39d132647 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4277,6 +4277,10 @@ namedpipe(void)
 {
     char *tnam = gettempname(NULL, 1);
 
+    if (!tnam) {
+	zerr("failed to create named pipe: %e", errno);
+	return NULL;
+    }
 # ifdef HAVE_MKFIFO
     if (mkfifo(tnam, 0600) < 0){
 # else