mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
* complete.c (insert_text): Fix buffer overflow.
This commit is contained in:
parent
6b6a850816
commit
ac26b4f20e
@ -1,3 +1,7 @@
|
||||
2002-03-25 Andrew V. Samoilov <kai@cmail.ru>
|
||||
|
||||
* complete.c (insert_text): Fix buffer overflow.
|
||||
|
||||
2002-03-21 Andrew V. Samoilov <kai@cmail.ru>
|
||||
|
||||
* man2hlp.c (handle_command): Handle backslash quoting
|
||||
|
@ -797,8 +797,8 @@ static int insert_text (WInput *in, char *text, int len)
|
||||
}
|
||||
if (strlen (in->buffer)+1 < in->current_max_len){
|
||||
if (len > 0){
|
||||
int i, l = strlen (&in->buffer [end]);
|
||||
for (i = l + 1; i >= 0; i--)
|
||||
int i = strlen (&in->buffer [end]);
|
||||
for (; i >= 0; i--)
|
||||
in->buffer [end + len + i] = in->buffer [end + i];
|
||||
} else if (len < 0){
|
||||
char *p = in->buffer + end + len, *q = in->buffer + end;
|
||||
|
Loading…
Reference in New Issue
Block a user