about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-04-22 20:49:39 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-04-22 20:49:39 +0000
commite49e41725abbd851e501855c4139b4826093ba0d (patch)
tree7ba149fbbbc3a31e686cfb933e7c51de1db7ec29
parentcb4ff5e9703d6641b10ca053f1caad2a8b19d2f9 (diff)
downloadzsh-e49e41725abbd851e501855c4139b4826093ba0d.tar.gz
zsh-e49e41725abbd851e501855c4139b4826093ba0d.tar.xz
zsh-e49e41725abbd851e501855c4139b4826093ba0d.zip
unposted: add test for valid identifier to 30431
-rw-r--r--ChangeLog4
-rw-r--r--Src/subst.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c3b37fba..c23237baa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2012-04-22  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* unposted: Src/subst.c: add test for valid identifier to 30431.
+
 	* Test/D04parameter.ztst: 30439: Src/subst.c,
 	Test/D04parameter.ztst: ${...:*...} with nonexistent or
 	non-array variable second should return no results.
@@ -16235,5 +16237,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5638 $
+* $Revision: 1.5639 $
 *****************************************************
diff --git a/Src/subst.c b/Src/subst.c
index 079d9efde..932f41287 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2879,7 +2879,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
     } else if (inbrace && (*s == '|' || *s == Bar ||
 			   *s == '*' || *s == Star)) {
 	int intersect = (*s == '*' || *s == Star);
-	char **compare = getaparam(++s), **ap, **apsrc;
+	char **compare, **ap, **apsrc;
+	++s;
+	if (*itype_end(s, IIDENT, 0)) {
+	    untokenize(s);
+	    zerr("not an identifier: %s", s);
+	    return NULL;
+	}
+	compare = getaparam(s);
 	if (compare) {
 	    HashTable ht = newuniqtable(arrlen(compare)+1);
 	    int present;