From 1b2d095217d1560a648032aa192057b935ce9460 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 31 May 2001 09:43:59 +0000 Subject: 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) --- Src/Zle/complete.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Src/Zle/complete.c') 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); -- cgit v1.2.3