0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.0.1225: no check for spell region being zero

Problem:    No check for spell region being zero. (geeknik)
Solution:   Check for zero. (closes #2252)
This commit is contained in:
Bram Moolenaar
2017-10-27 00:57:05 +02:00
parent cf1ba35fc2
commit ee03b94124
3 changed files with 12 additions and 1 deletions

View File

@@ -4277,7 +4277,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
flags |= WF_REGION;
l = *p - '0';
if (l > spin->si_region_count)
if (l == 0 || l > spin->si_region_count)
{
smsg((char_u *)_("Invalid region nr in %s line %d: %s"),
fname, lnum, p);