From 4887c3dc1c64d884f14a7c5f7baa14e7a9e7100c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 4 Aug 2020 22:22:44 -0400 Subject: vim-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 vim/vim#6578) https://github.com/vim/vim/commit/282f9c64e570e832d3eba12950da15c9f1a40f06 --- src/nvim/search.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nvim/search.c b/src/nvim/search.c index b105d99d7c..fc82e81472 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -1612,8 +1612,9 @@ static bool 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