1
0
forked from aniani/vim

updated for version 7.4.624

Problem:    May leak memory or crash when vim_realloc() returns NULL.
Solution:   Handle a NULL value properly. (Mike Williams)
This commit is contained in:
Bram Moolenaar
2015-02-10 18:34:01 +01:00
parent a1d2c58985
commit 9abd5c6507
5 changed files with 47 additions and 0 deletions

View File

@@ -3431,10 +3431,14 @@ get_keystroke()
buf = alloc(buflen);
else if (maxlen < 10)
{
char_u *t_buf = buf;
/* Need some more space. This might happen when receiving a long
* escape sequence. */
buflen += 100;
buf = vim_realloc(buf, buflen);
if (buf == NULL)
vim_free(t_buf);
maxlen = (buflen - 6 - len) / 3;
}
if (buf == NULL)