summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-09-10 15:56:00 +0000
committerClint Adams <clint@users.sourceforge.net>2008-09-10 15:56:00 +0000
commitc543084471bf8f267c1ebf22c15e2e87a9a5d25d (patch)
tree2c91da3f1d568ddd2331abb39ebf29db968d9dfa
parentb4ee5adc251faffae472fb176214789327bf63b7 (diff)
downloadzsh-c543084471bf8f267c1ebf22c15e2e87a9a5d25d.tar.gz
zsh-c543084471bf8f267c1ebf22c15e2e87a9a5d25d.zip
25637: dereference prog after the NULL check.
-rw-r--r--ChangeLog4
-rw-r--r--Src/exec.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f351250e..976013bda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-10 Clint Adams <clint@zsh.org>
+
+ * 25637: Src/exec.c: dereference prog after the NULL check.
+
2008-09-08 Clint Adams <clint@zsh.org>
* 25636: Src/Zle/zle_tricky.c: free s before returning with an
diff --git a/Src/exec.c b/Src/exec.c
index e638b9f6e..a78212888 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4483,11 +4483,12 @@ getfpfunc(char *s, int *ksh, char **fname)
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))