diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-11-25 16:31:51 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-25 16:31:51 +0000 |
commit | ef2c325f5e3c437b722bb96bf369ba2a5c541163 (patch) | |
tree | dc85f0dc98dce1937b459d8d3882473f25db03c3 /src/spellfile.c | |
parent | c1cf4c91072f91b6b8dd636627a4ddf6f4b21f16 (diff) | |
download | vim-git-ef2c325f5e3c437b722bb96bf369ba2a5c541163.tar.gz |
patch 9.0.0949: crash when unletting a variable while listing variablesv9.0.0949
Problem: Crash when unletting a variable while listing variables.
Solution: Disallow changing a hashtable while going over the entries.
(closes #11435)
Diffstat (limited to 'src/spellfile.c')
-rw-r--r-- | src/spellfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/spellfile.c b/src/spellfile.c index b5db526ed..6247968a8 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -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; } |