summaryrefslogtreecommitdiff
path: root/src/cindent.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-12 13:48:18 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-12 13:48:18 +0100
commit02ad46394e8f887b60fda994f8a5da2ac1937b23 (patch)
tree88d500f542feded3c357c2d6c6afc1bdfee2a957 /src/cindent.c
parent9b4a15d5dba354d2e1e02871470bad103f34769a (diff)
downloadvim-git-02ad46394e8f887b60fda994f8a5da2ac1937b23.tar.gz
patch 8.2.0112: illegal memory access when using 'cindent'v8.2.0112
Problem: Illegal memory access when using 'cindent'. Solution: Check for NUL byte. (Dominique Pelle, closes #5470)
Diffstat (limited to 'src/cindent.c')
-rw-r--r--src/cindent.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cindent.c b/src/cindent.c
index c7caed68f..3dc7b1635 100644
--- a/src/cindent.c
+++ b/src/cindent.c
@@ -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++