about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-07-19 14:04:57 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-07-19 14:04:57 +0000
commite4c9131b83f5374f805d9316679e4b82c9e8ce78 (patch)
tree4022c13b93c9cde064b897961203f09648e8c98a
parentc4e03794081621b260d9a5dbd80d7240d4788d3f (diff)
downloadzsh-e4c9131b83f5374f805d9316679e4b82c9e8ce78.tar.gz
zsh-e4c9131b83f5374f805d9316679e4b82c9e8ce78.tar.xz
zsh-e4c9131b83f5374f805d9316679e4b82c9e8ce78.zip
a bit of security for a VARARR() (12314)
-rw-r--r--ChangeLog4
-rw-r--r--Src/Zle/compmatch.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d1cdd01a..98804a6ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-07-19  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 12314: Src/Zle/compmatch.c: a bit of security for a VARARR()
+	
 2000-07-19  Peter Stephenson  <pws@cambridgesiliconradio.com>
 
 	* 12313: Doc/Zsh/metafaq.yo: bad phrasing corrected.
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index aa7890407..3cb0ea12f 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -442,7 +442,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 {
     int ll = strlen(l), lw = strlen(w), oll = ll, olw = lw;
     int il = 0, iw = 0, t, ind, add, he = 0, bpc, obc = bc, bslash;
-    VARARR(unsigned char, ea, ll + 1);
+    VARARR(unsigned char, ea, (ll > lw ? ll : lw) + 1);
     char *ow;
     Cmlist ms;
     Cmatcher mp, lm = NULL;