about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-12-11 22:21:26 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-12-11 22:21:26 +0000
commit512c62fc03c42835e1ff5c0f09a326d99768693f (patch)
tree5d4130d5ab015627e56ae92f90f6dbfffb504ae5
parented9f525f1be7755a5c6a91301581e9ecf4294e29 (diff)
downloadzsh-512c62fc03c42835e1ff5c0f09a326d99768693f.tar.gz
zsh-512c62fc03c42835e1ff5c0f09a326d99768693f.tar.xz
zsh-512c62fc03c42835e1ff5c0f09a326d99768693f.zip
27503: fix crash with hook functions
-rw-r--r--ChangeLog7
-rw-r--r--Src/utils.c1
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 982c129bc..07cb62864 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-11  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 27503: Src/utils.c: fix crash when changing a hook
+	function inside a hook function of the same type.
+
 2009-12-10  Clint Adams  <clint@zsh.org>
 
 	* 27494: Completion/Debian/Command/_bug: reportbug --paranoid,
@@ -12462,5 +12467,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4837 $
+* $Revision: 1.4838 $
 *****************************************************
diff --git a/Src/utils.c b/Src/utils.c
index bb18eb859..4cb2ba70d 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1181,6 +1181,7 @@ callhookfunc(char *name, LinkList lnklst, int arrayp, int *retval)
 	memcpy(arrnam + namlen, HOOK_SUFFIX, HOOK_SUFFIX_LEN);
 
 	if ((arrptr = getaparam(arrnam))) {
+	    arrptr = arrdup(arrptr);
 	    for (; *arrptr; arrptr++) {
 		if ((shfunc = getshfunc(*arrptr))) {
 		    int newret = doshfunc(shfunc, lnklst, 1);