Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: stripkshdef dereference before NULL check
- X-seq: zsh-workers 25637
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: stripkshdef dereference before NULL check
- Date: Wed, 10 Sep 2008 15:50:05 +0000
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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