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.
diff --git a/src/spellfile.c b/src/spellfile.c
index fc365e2..8a029dc 100644
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -993,7 +993,6 @@
salitem_T *smp;
int ccnt;
char_u *p;
- int c = NUL;
slang->sl_sofo = FALSE;
@@ -1017,6 +1016,8 @@
// <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)
diff --git a/src/version.c b/src/version.c
index 0b31e54..88bd908 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1169,
+/**/
1168,
/**/
1167,