summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2017-06-19 16:18:36 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2017-06-19 16:18:36 -0700
commit8a62bbb46a3c916a42e7baa83df7b8ada3cf1ede (patch)
tree78c5647475c9306a5a8a2864c1329353e3b9c176
parentc186ae41bd783ea07c98c2e6d5fd19f16d62619e (diff)
downloadzsh-8a62bbb46a3c916a42e7baa83df7b8ada3cf1ede.tar.gz
zsh-8a62bbb46a3c916a42e7baa83df7b8ada3cf1ede.tar.xz
zsh-8a62bbb46a3c916a42e7baa83df7b8ada3cf1ede.zip
41319: dupstring a possibly readonly string before modifying
-rw-r--r--ChangeLog3
-rw-r--r--Src/cond.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8270102b9..5a1995a36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-06-19  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* Mikael Magnusson: 41319: Src/cond.c: dupstring a possibly
+	readonly string before modifying
+
 	* 41322 + comment: Src/input.c: reduce number of changes in signal
 	queuing/blocking state during shingetline() to improve read speed
 
diff --git a/Src/cond.c b/Src/cond.c
index a63841234..b9a47cea5 100644
--- a/Src/cond.c
+++ b/Src/cond.c
@@ -139,7 +139,7 @@ evalcond(Estate state, char *fromtest)
 		l = 2;
 	    }
 	    if (name && IS_DASH(name[0]))
-		untokenize(errname = name);
+		untokenize(errname = dupstring(name));
 	    else if (strs[0] && IS_DASH(*strs[0]))
 		untokenize(errname = strs[0]);
 	    else