0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1169: write NUL past allocated space using corrupted spell file

Problem:    Write NUL past allocated space using corrupted spell file.
            (Markus Vervier)
Solution:   Init "c" every time.
This commit is contained in:
Bram Moolenaar
2020-07-10 20:03:03 +02:00
parent 92053ce59e
commit 97d2f34c87
2 changed files with 4 additions and 1 deletions

View File

@@ -993,7 +993,6 @@ read_sal_section(FILE *fd, slang_T *slang)
salitem_T *smp;
int ccnt;
char_u *p;
int c = NUL;
slang->sl_sofo = FALSE;
@@ -1017,6 +1016,8 @@ read_sal_section(FILE *fd, slang_T *slang)
// <sal> : <salfromlen> <salfrom> <saltolen> <salto>
for (; gap->ga_len < cnt; ++gap->ga_len)
{
int c = NUL;
smp = &((salitem_T *)gap->ga_data)[gap->ga_len];
ccnt = getc(fd); // <salfromlen>
if (ccnt < 0)

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1169,
/**/
1168,
/**/