]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.1169: write NUL past allocated space using corrupted spell file v8.2.1169
authorBram Moolenaar <Bram@vim.org>
Fri, 10 Jul 2020 18:03:03 +0000 (20:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 10 Jul 2020 18:03:03 +0000 (20:03 +0200)
Problem:    Write NUL past allocated space using corrupted spell file.
            (Markus Vervier)
Solution:   Init "c" every time.

src/spellfile.c
src/version.c

index fc365e2a03a78d5043f6a9f7fec6efde1bcffad3..8a029dc719409f7aa372a148ce4e3a2c423e9577 100644 (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)
index 0b31e54b0ab0433eed5889fd51736f8aab3e6248..88bd908c65fbd9747f7d174d168410ea42a2e7eb 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1169,
 /**/
     1168,
 /**/