comparison src/search.c @ 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 9064044fd4f6
children 003f51ef2e5c
comparison
equal deleted inserted replaced
21627:29541e785bdd 21628:e23f829c187d
1926 for (p = line + (lnum == startpos->lnum 1926 for (p = line + (lnum == startpos->lnum
1927 ? startpos->col + 1 : 0); *p; ++p) 1927 ? startpos->col + 1 : 0); *p; ++p)
1928 { 1928 {
1929 if (lnum == endpos->lnum && (colnr_T)(p - line) >= endpos->col) 1929 if (lnum == endpos->lnum && (colnr_T)(p - line) >= endpos->col)
1930 break; 1930 break;
1931 if (*p == ')' && p[delim_len + 1] == '"' 1931 if (*p == ')' && STRNCMP(delim_copy, p + 1, delim_len) == 0
1932 && STRNCMP(delim_copy, p + 1, delim_len) == 0) 1932 && p[delim_len + 1] == '"')
1933 { 1933 {
1934 found = TRUE; 1934 found = TRUE;
1935 break; 1935 break;
1936 } 1936 }
1937 } 1937 }