about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-15 09:41:47 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-15 09:41:47 +0000
commitf04b4c74a70280de871b3487558772045d498a27 (patch)
tree6e5761c58a9b31ee89320924f1e8326c89c8ae34
parent6d8ec99c3519dce73c86705841254c6b68011055 (diff)
downloadzsh-f04b4c74a70280de871b3487558772045d498a27.tar.gz
zsh-f04b4c74a70280de871b3487558772045d498a27.tar.xz
zsh-f04b4c74a70280de871b3487558772045d498a27.zip
more security in completion matching (11924)
-rw-r--r--ChangeLog2
-rw-r--r--Src/Zle/compmatch.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 40b7bc380..049fdbf21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@
 
 2000-06-15  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 11924: Src/Zle/compmatch.c: more security in completion matching
+	
 	* 11915: Completion/Core/_files, Doc/Zsh/compsys.yo: make _files
  	try each pattern only once (and stop after `*')
 	
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index 8cdfddede..180dce5df 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -488,7 +488,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	 */
 
 	bslash = 0;
-	if (test && !sfx &&
+	if (test && !sfx && lw &&
 	    (l[ind] == w[ind] ||
 	     (bslash = (lw > 1 && w[ind] == '\\' &&
 			(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {
@@ -803,7 +803,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	/* Same code as at the beginning, used in top-level calls. */
 
 	bslash = 0;
-	if ((!test || sfx) &&
+	if ((!test || sfx) && lw &&
 	    (l[ind] == w[ind] ||
 	     (bslash = (lw > 1 && w[ind] == '\\' &&
 			(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {