mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
vim-patch:8.1.1824: crash when correctly spelled word is very long (#10725)
Problem: Crash when correctly spelled word is very long. (Ben Kraft)
Solution: Check word length before copying. (closes vim/vim#4778)
5bcc5a1ff9
This commit is contained in:

committed by
Daniel Hahler

parent
e4bd31dbac
commit
ce628e1187
@@ -1807,9 +1807,11 @@ void count_common_word(slang_T *lp, char_u *word, int len, int count)
|
||||
char_u buf[MAXWLEN];
|
||||
char_u *p;
|
||||
|
||||
if (len == -1)
|
||||
if (len == -1) {
|
||||
p = word;
|
||||
else {
|
||||
} else if (len >= MAXWLEN) {
|
||||
return;
|
||||
} else {
|
||||
STRLCPY(buf, word, len + 1);
|
||||
p = buf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user