]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3171: another illegal memory access in test v8.2.3171
authorBram Moolenaar <Bram@vim.org>
Thu, 15 Jul 2021 21:44:54 +0000 (23:44 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 15 Jul 2021 21:44:54 +0000 (23:44 +0200)
Problem:    Another illegal memory access in test.
Solution:   Check pointer is after the start of the line.

src/userfunc.c
src/version.c

index d8c943b23d475f60b9544bbe65ace18e57c139c1..3dfa68097221bf6ab90fe1143669f0ada2389c9d 100644 (file)
@@ -875,7 +875,7 @@ get_function_body(
                --end;
                while (end > p && VIM_ISWHITE(*end))
                    --end;
-               if (end > p - 2 && end[-1] == '=' && end[0] == '>')
+               if (end > p + 2 && end[-1] == '=' && end[0] == '>')
                {
                    // found trailing "=> {", start of an inline function
                    if (nesting == MAX_FUNC_NESTING - 1)
index 5b3a97b439b80396ef5c46a6be42cce52aa95fbd..3caf18dcad6b0230a54f9f0a7e93e095c59f87aa 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3171,
 /**/
     3170,
 /**/