diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-12 18:40:27 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-17 19:06:50 -0500 |
commit | 03da3697a40d56961250028ce60a49ea6e87728b (patch) | |
tree | b83c6e6fd607de06509d39bdd2dca13068fdc598 /src/nvim/indent_c.c | |
parent | fd89ad7bfb1534c42c99b36ca025ea42ccbee7e1 (diff) | |
download | rneovim-03da3697a40d56961250028ce60a49ea6e87728b.tar.gz rneovim-03da3697a40d56961250028ce60a49ea6e87728b.tar.bz2 rneovim-03da3697a40d56961250028ce60a49ea6e87728b.zip |
vim-patch:8.2.0112: illegal memory access when using 'cindent'
Problem: Illegal memory access when using 'cindent'.
Solution: Check for NUL byte. (Dominique Pelle, closes vim/vim#5470)
https://github.com/vim/vim/commit/02ad46394e8f887b60fda994f8a5da2ac1937b23
Diffstat (limited to 'src/nvim/indent_c.c')
-rw-r--r-- | src/nvim/indent_c.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 1ca1f3dae5..67a7e58ed7 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -461,6 +461,9 @@ cin_iscase ( if (cin_starts_with(s, "case")) { for (s += 4; *s; ++s) { s = cin_skipcomment(s); + if (*s == NUL) { + break; + } if (*s == ':') { if (s[1] == ':') /* skip over "::" for C++ */ ++s; |