summaryrefslogtreecommitdiff
path: root/src/spell.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-06 22:48:02 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-06 22:48:02 +0200
commit5bcc5a1ff94bbab1b175e35a72e3df974106b393 (patch)
treeb90a4c3a1cae32cc2e68942d6da1802cd827f2b1 /src/spell.c
parentd7663c22c6c1ff0f86b81371586fbc851d3a3e9e (diff)
downloadvim-git-5bcc5a1ff94bbab1b175e35a72e3df974106b393.tar.gz
patch 8.1.1824: crash when correctly spelled word is very longv8.1.1824
Problem: Crash when correctly spelled word is very long. (Ben Kraft) Solution: Check word length before copying. (closes #4778)
Diffstat (limited to 'src/spell.c')
-rw-r--r--src/spell.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/spell.c b/src/spell.c
index dda81d9d5..83c232c52 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -2073,6 +2073,8 @@ count_common_word(
if (len == -1)
p = word;
+ else if (len >= MAXWLEN)
+ return;
else
{
vim_strncpy(buf, word, len);