about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/params.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d1bd64b3f..950d44d9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-12-30  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 32208: Src/params.c: always reset pathchecked when the path
+	array is modified in arrvarsetfn(), to avoid bad dereference
+
 	* 32205: Completion/Zsh/Command/_cd: skip cdpath search when
 	the prefix begins with "../" (bug introduced by 31714)
 
diff --git a/Src/params.c b/Src/params.c
index 26ad6b221..ad9e3470b 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -3380,8 +3380,12 @@ arrvarsetfn(Param pm, char **x)
 	*dptr = mkarray(NULL);
     else
 	*dptr = x;
-    if (pm->ename && x)
-	arrfixenv(pm->ename, x);
+    if (pm->ename) {
+	if (x)
+	    arrfixenv(pm->ename, x);
+	else if (*dptr == path)
+	    pathchecked = path;
+    }
 }
 
 /**/