0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

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)
This commit is contained in:
Bram Moolenaar
2020-08-04 21:46:18 +02:00
parent e46a2ed0d8
commit 282f9c64e5
2 changed files with 4 additions and 2 deletions

View File

@@ -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) if (lnum == endpos->lnum && (colnr_T)(p - line) >= endpos->col)
break; break;
if (*p == ')' && p[delim_len + 1] == '"' if (*p == ')' && STRNCMP(delim_copy, p + 1, delim_len) == 0
&& STRNCMP(delim_copy, p + 1, delim_len) == 0) && p[delim_len + 1] == '"')
{ {
found = TRUE; found = TRUE;
break; break;

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1364,
/**/ /**/
1363, 1363,
/**/ /**/