about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-06-09 14:40:54 +0000
committerClint Adams <clint@users.sourceforge.net>2000-06-09 14:40:54 +0000
commit716f5d4e3940ab5129eda866aa20b8fd2d458999 (patch)
treeff8a005a8daebbaf43b18ecadc88214eb696a491
parent4997db3470da7dd8b538b6e8df953c309c1fdda6 (diff)
downloadzsh-716f5d4e3940ab5129eda866aa20b8fd2d458999.tar.gz
zsh-716f5d4e3940ab5129eda866aa20b8fd2d458999.tar.xz
zsh-716f5d4e3940ab5129eda866aa20b8fd2d458999.zip
11839: endtrapscope() null pointer dereference prevention
-rw-r--r--ChangeLog5
-rw-r--r--Src/signals.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d5f55d8b..c6fb2f1fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-09  Clint Adams  <schizo@debian.org>
+
+	* 11839: Src/signals.c: prevent segmentation fault in
+	endtrapscope() by not dereferencing null pointers.
+
 2000-06-09  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 11836: Src/Zle/compcore.c, Src/Zle/complist.c: fix for
diff --git a/Src/signals.c b/Src/signals.c
index 9b9ef97aa..264b68a53 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -853,7 +853,7 @@ endtrapscope(void)
 	    if (sigtrapped[sig])
 		unsettrap(sig);
 	    sigtrapped[sig] = st->flags;
-	    if (st->flags) {
+	    if (st->flags && (st->list != NULL)) {
 		Eprog prog = (st->flags & ZSIG_FUNC) ?
 		    ((Shfunc) st->list)->funcdef : (Eprog) st->list;
 		/* prevent settrap from saving this */