1
0
forked from aniani/vim

patch 9.0.0949: crash when unletting a variable while listing variables

Problem:    Crash when unletting a variable while listing variables.
Solution:   Disallow changing a hashtable while going over the entries.
            (closes #11435)
This commit is contained in:
Bram Moolenaar
2022-11-25 16:31:51 +00:00
parent c1cf4c9107
commit ef2c325f5e
21 changed files with 143 additions and 68 deletions

View File

@@ -2643,7 +2643,7 @@ spell_read_aff(spellinfo_T *spin, char_u *fname)
smsg(_("Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s line %d: %s"),
fname, lnum, items[1]);
STRCPY(cur_aff->ah_key, items[1]);
hash_add(tp, cur_aff->ah_key);
hash_add(tp, cur_aff->ah_key, "spelling");
cur_aff->ah_combine = (*items[2] == 'Y');
}
@@ -2994,7 +2994,7 @@ spell_read_aff(spellinfo_T *spin, char_u *fname)
p = vim_strsave(items[i]);
if (p == NULL)
break;
hash_add(&spin->si_commonwords, p);
hash_add(&spin->si_commonwords, p, "spelling");
}
}
}
@@ -3312,7 +3312,7 @@ process_compflags(
id = spin->si_newcompID--;
} while (vim_strchr((char_u *)"/?*+[]\\-^", id) != NULL);
ci->ci_newID = id;
hash_add(&aff->af_comp, ci->ci_key);
hash_add(&aff->af_comp, ci->ci_key, "spelling");
}
*tp++ = id;
}