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

PATCH: stripkshdef dereference before NULL check



Either the if(!prog) is superfluous or the dereference should happen
after it.

Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.148
diff -u -r1.148 exec.c
--- Src/exec.c	5 Sep 2008 21:02:14 -0000	1.148
+++ Src/exec.c	10 Sep 2008 15:42:12 -0000
@@ -4483,11 +4483,12 @@
 Eprog
 stripkshdef(Eprog prog, char *name)
 {
-    Wordcode pc = prog->prog;
+    Wordcode pc;
     wordcode code;
 
     if (!prog)
 	return NULL;
+    pc = prog->prog;
     code = *pc++;
     if (wc_code(code) != WC_LIST ||
 	(WC_LIST_TYPE(code) & (Z_SYNC|Z_END|Z_SIMPLE)) != (Z_SYNC|Z_END|Z_SIMPLE))



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