]> granicus.if.org Git - vim/commitdiff
patch 8.2.1364: invalid memory access when searching for raw string v8.2.1364
authorBram Moolenaar <Bram@vim.org>
Tue, 4 Aug 2020 19:46:18 +0000 (21:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 4 Aug 2020 19:46:18 +0000 (21:46 +0200)
Problem:    Invalid memory access when searching for raw string.
Solution:   Check for delimiter match before following quote. (closes #6578)

src/search.c
src/version.c

index 91a26dd36a6f0df7519f7c8e3d03628dfb504ed7..7391ab0fbf811837355686b18398f3c1cc2dddd8 100644 (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)
                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;
index 376c8fd641d9e5fede291f1cd2cde6f3f35d9ab7..366d3ab7775182aff996b51a10088f3b0f1e38c7 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1364,
 /**/
     1363,
 /**/