• R/O
  • SSH

vim: 提交

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

修订版9f4648953f1ab203d9da6293b03fbb4e62436feb (tree)
时间2020-01-12 22:00:04
作者Bram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.0112: illegal memory access when using 'cindent'

Commit: https://github.com/vim/vim/commit/02ad46394e8f887b60fda994f8a5da2ac1937b23
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 12 13:48:18 2020 +0100

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 https://github.com/vim/vim/issues/5470)

更改概述

差异

diff -r 8d183ace1c33 -r 9f4648953f1a src/cindent.c
--- a/src/cindent.c Sat Jan 11 16:15:05 2020 +0100
+++ b/src/cindent.c Sun Jan 12 14:00:04 2020 +0100
@@ -582,6 +582,8 @@
582582 for (s += 4; *s; ++s)
583583 {
584584 s = cin_skipcomment(s);
585+ if (*s == NUL)
586+ break;
585587 if (*s == ':')
586588 {
587589 if (s[1] == ':') // skip over "::" for C++
diff -r 8d183ace1c33 -r 9f4648953f1a src/testdir/test_cindent.vim
--- a/src/testdir/test_cindent.vim Sat Jan 11 16:15:05 2020 +0100
+++ b/src/testdir/test_cindent.vim Sun Jan 12 14:00:04 2020 +0100
@@ -5251,4 +5251,13 @@
52515251 enew! | close
52525252 endfunc
52535253
5254+" this was going beyond the end of the line.
5255+func Test_cindent_case()
5256+ new
5257+ call setline(1, "case x: // x")
5258+ set cindent
5259+ norm! f:a:
5260+ bwipe!
5261+endfunc
5262+
52545263 " vim: shiftwidth=2 sts=2 expandtab
diff -r 8d183ace1c33 -r 9f4648953f1a src/version.c
--- a/src/version.c Sat Jan 11 16:15:05 2020 +0100
+++ b/src/version.c Sun Jan 12 14:00:04 2020 +0100
@@ -743,6 +743,8 @@
743743 static int included_patches[] =
744744 { /* Add new patch number below this line */
745745 /**/
746+ 112,
747+/**/
746748 111,
747749 /**/
748750 110,
Show on old repository browser