0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

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 #5470)
This commit is contained in:
Bram Moolenaar
2020-01-12 13:48:18 +01:00
parent 9b4a15d5db
commit 02ad46394e
3 changed files with 13 additions and 0 deletions

View File

@@ -582,6 +582,8 @@ cin_iscase(
for (s += 4; *s; ++s)
{
s = cin_skipcomment(s);
if (*s == NUL)
break;
if (*s == ':')
{
if (s[1] == ':') // skip over "::" for C++

View File

@@ -5251,4 +5251,13 @@ func Test_cindent_56()
enew! | close
endfunc
" this was going beyond the end of the line.
func Test_cindent_case()
new
call setline(1, "case x: // x")
set cindent
norm! f:a:
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
112,
/**/
111,
/**/