changeset 21628:e23f829c187d v8.2.1364

patch 8.2.1364: invalid memory access when searching for raw string Commit: https://github.com/vim/vim/commit/282f9c64e570e832d3eba12950da15c9f1a40f06 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 4 21:46:18 2020 +0200 patch 8.2.1364: invalid memory access when searching for raw string Problem: Invalid memory access when searching for raw string. Solution: Check for delimiter match before following quote. (closes https://github.com/vim/vim/issues/6578)
author Bram Moolenaar <Bram@vim.org>
date Tue, 04 Aug 2020 22:00:04 +0200
parents 29541e785bdd
children 87a1c4717817
files src/search.c src/version.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -1928,8 +1928,8 @@ find_rawstring_end(char_u *linep, pos_T 
 	{
 	    if (lnum == endpos->lnum && (colnr_T)(p - line) >= endpos->col)
 		break;
-	    if (*p == ')' && p[delim_len + 1] == '"'
-			  && STRNCMP(delim_copy, p + 1, delim_len) == 0)
+	    if (*p == ')' && STRNCMP(delim_copy, p + 1, delim_len) == 0
+			  && p[delim_len + 1] == '"')
 	    {
 		found = TRUE;
 		break;
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1364,
+/**/
     1363,
 /**/
     1362,