summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-01-15 17:15:04 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-01-15 17:15:04 +0000
commitebd7fdd9326cf36feda3b0ca906d7b9b8bf79cb5 (patch)
tree767136a952b887ce8c92569a18967ae3542221e1
parent51c5c85c23553487785cc0622f6137a3f520ddaf (diff)
downloadzsh-ebd7fdd9326cf36feda3b0ca906d7b9b8bf79cb5.tar.gz
zsh-ebd7fdd9326cf36feda3b0ca906d7b9b8bf79cb5.tar.xz
zsh-ebd7fdd9326cf36feda3b0ca906d7b9b8bf79cb5.zip
40362: Fix setting of parameter values in compvalues
-rw-r--r--ChangeLog6
-rw-r--r--Src/Zle/computil.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 37b1a0b1e..02a4469c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-15  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 40362: Src/Zle/computil.c: need duplicated values for setting
+	parameter in compvalues.  Was causing obscure but surprisingly
+	rare crashes in value completion.
+
 2017-01-13  Eric Cook  <llua@gmx.com>
 
 	* earnestly: 40355: Completion/Unix/Command/_mpc: improve
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 7bf95351f..5b9ceec1a 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -3569,8 +3569,8 @@ bin_compvalues(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 	    Cvval val = cv_get_val(cv_laststate.d, args[1]);
 
 	    if (val && val->arg) {
-		setsparam(args[2], val->arg->descr);
-		setsparam(args[3], val->arg->action);
+		setsparam(args[2], ztrdup(val->arg->descr));
+		setsparam(args[3], ztrdup(val->arg->action));
 
 		if (args[4])
 		    setsparam(args[4], ztrdup(val->name));