mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 13:33:52 +01:00
21663: check for string overflow
This commit is contained in:
parent
2396eb34e4
commit
c26b8accb4
@ -1,3 +1,8 @@
|
||||
2005-08-18 Andrey Borzenkov <bor@zsh.org>
|
||||
|
||||
* 21663: Src/Zle/complete.c: check for string overflow
|
||||
in do_comp_vars()
|
||||
|
||||
2005-08-18 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* unposted: Doc/Zsh/contrib.yo, Functions/Zle/insert-unicode-char:
|
||||
|
@ -821,6 +821,8 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
|
||||
add = -1;
|
||||
} else {
|
||||
p = compprefix + 1 + (*compprefix == Meta);
|
||||
if (p > compprefix + l)
|
||||
p = compprefix + l;
|
||||
add = 1;
|
||||
}
|
||||
for (;;) {
|
||||
@ -833,10 +835,9 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
|
||||
if (add > 0) {
|
||||
if (p == compprefix + l)
|
||||
return 0;
|
||||
if (*p == Meta)
|
||||
p += 2;
|
||||
else
|
||||
p++;
|
||||
p = p + 1 + (*p == Meta);
|
||||
if (p > compprefix + l)
|
||||
p = compprefix + l;
|
||||
} else {
|
||||
if (p == compprefix)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user