]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3170: Illegal memory access in test v8.2.3170
authorBram Moolenaar <Bram@vim.org>
Thu, 15 Jul 2021 21:15:59 +0000 (23:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 15 Jul 2021 21:15:59 +0000 (23:15 +0200)
Problem:    Illegal memory access in test.
Solution:   Check pointer is not before the start of the line.

src/userfunc.c
src/version.c

index e21f15c1425373aecc54939313f9b91b28896859..d8c943b23d475f60b9544bbe65ace18e57c139c1 100644 (file)
@@ -870,7 +870,7 @@ get_function_body(
            end = p + STRLEN(p) - 1;
            while (end > p && VIM_ISWHITE(*end))
                --end;
-           if (*end == '{')
+           if (end > p && *end == '{')
            {
                --end;
                while (end > p && VIM_ISWHITE(*end))
index f436e549048e09a8e5a78534a3c23862b5dc7ba2..5b3a97b439b80396ef5c46a6be42cce52aa95fbd 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3170,
 /**/
     3169,
 /**/