about summary refs log tree commit diff
path: root/Src/Zle/complete.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-05-31 09:43:59 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-05-31 09:43:59 +0000
commit1b2d095217d1560a648032aa192057b935ce9460 (patch)
tree4126aa0dc04cde27de4cc3fe83de835190f34e71 /Src/Zle/complete.c
parentae5e34db253ffd89369dd67835999c23dd9e62c2 (diff)
downloadzsh-1b2d095217d1560a648032aa192057b935ce9460.tar.gz
zsh-1b2d095217d1560a648032aa192057b935ce9460.tar.xz
zsh-1b2d095217d1560a648032aa192057b935ce9460.zip
fix two memory leaks (at least I hope they are fixed) and some out-of-bound array accesses, plus some defensive programming for heap allocated param structs (14605)
Diffstat (limited to 'Src/Zle/complete.c')
-rw-r--r--Src/Zle/complete.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 5c166291e..574e638ac 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -403,7 +403,7 @@ parse_class(Cpattern p, unsigned char *s, unsigned char e)
 
     n = !n;
     while (*s && (k || *s != e)) {
-	if (s[1] == '-' && s[2] != e) {
+	if (s[1] == '-' && s[2] && s[2] != e) {
 	    /* a run of characters */
 	    for (j = (int) *s; j <= (int) s[2]; j++)
 		p->tab[j] = (eq ? i++ : n);