Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: BUG: "unset pipestatus" coredump



Geoff Wing wrote:

> (gdb) run -f
> % unset pipestatus
> 
> Program received signal SIGSEGV, Segmentation fault.

Yes, better test if we really get an array.

Bye
  Sven

Index: Src/params.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/params.c,v
retrieving revision 1.34
diff -u -r1.34 params.c
--- Src/params.c	2001/04/06 07:38:36	1.34
+++ Src/params.c	2001/04/06 07:46:50
@@ -2873,11 +2873,15 @@
 static void
 pipestatsetfn(Param pm, char **x)
 {
-    int i;
+    if (x) {
+        int i;
 
-    for (i = 0; *x && i < MAX_PIPESTATS; i++, x++)
-	pipestats[i] = atoi(*x);
-    numpipestats = i;
+        for (i = 0; *x && i < MAX_PIPESTATS; i++, x++)
+            pipestats[i] = atoi(*x);
+            numpipestats = i;
+    }
+    else
+        numpipestats = 0;
 }
 
 /**/

-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author