diff src/userfunc.c @ 25267:c69ebc71bd85 v8.2.3170

patch 8.2.3170: Illegal memory access in test Commit: https://github.com/vim/vim/commit/d8cee76b498507c48706f651aeb78b93b5376d00 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 15 23:15:59 2021 +0200 patch 8.2.3170: Illegal memory access in test Problem: Illegal memory access in test. Solution: Check pointer is not before the start of the line.
author Bram Moolenaar <Bram@vim.org>
date Thu, 15 Jul 2021 23:30:04 +0200
parents 1d6ff96306fc
children d42ac4880e0f
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -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))