comparison src/spellfile.c @ 29802:be40495e9cd8 v9.0.0240

patch 9.0.0240: crash when using ":mkspell" with an empty .dic file Commit: https://github.com/vim/vim/commit/6669de1b235843968e88844ca6d3c8dec4b01a9e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 21 20:33:47 2022 +0100 patch 9.0.0240: crash when using ":mkspell" with an empty .dic file Problem: Crash when using ":mkspell" with an empty .dic file. Solution: Check for an empty word tree.
author Bram Moolenaar <Bram@vim.org>
date Sun, 21 Aug 2022 21:45:03 +0200
parents 89e1d67814a9
children e4f23b4244ff
comparison
equal deleted inserted replaced
29801:ac6f7c97adef 29802:be40495e9cd8
5583 // let tree_add_word() know we're adding to the soundfolded tree 5583 // let tree_add_word() know we're adding to the soundfolded tree
5584 spin->si_sugtree = TRUE; 5584 spin->si_sugtree = TRUE;
5585 5585
5586 /* 5586 /*
5587 * Go through the whole case-folded tree, soundfold each word and put it 5587 * Go through the whole case-folded tree, soundfold each word and put it
5588 * in the trie. 5588 * in the trie. Bail out if the tree is empty.
5589 */ 5589 */
5590 byts = slang->sl_fbyts; 5590 byts = slang->sl_fbyts;
5591 idxs = slang->sl_fidxs; 5591 idxs = slang->sl_fidxs;
5592 if (byts == NULL || idxs == NULL)
5593 return FAIL;
5592 5594
5593 arridx[0] = 0; 5595 arridx[0] = 0;
5594 curi[0] = 1; 5596 curi[0] = 1;
5595 wordcount[0] = 0; 5597 wordcount[0] = 0;
5596 5598