* PATCH: stripkshdef dereference before NULL check
@ 2008-09-10 15:50 Clint Adams
0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2008-09-10 15:50 UTC (permalink / raw)
To: zsh-workers
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))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-09-10 15:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-10 15:50 PATCH: stripkshdef dereference before NULL check Clint Adams
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).