From 282f9c64e570e832d3eba12950da15c9f1a40f06 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 4 Aug 2020 21:46:18 +0200 Subject: 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 #6578) --- src/search.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/search.c') diff --git a/src/search.c b/src/search.c index 91a26dd36..7391ab0fb 100644 --- a/src/search.c +++ b/src/search.c @@ -1928,8 +1928,8 @@ find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos) { 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; -- cgit v1.2.1