aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-04 22:22:44 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-14 18:20:28 -0400
commit4887c3dc1c64d884f14a7c5f7baa14e7a9e7100c (patch)
tree6678914ceb86ad8bd9817ce23aef059827d3ebd7
parent037f5320767060d33c2b12cad17eefdeec66002a (diff)
downloadrneovim-4887c3dc1c64d884f14a7c5f7baa14e7a9e7100c.tar.gz
rneovim-4887c3dc1c64d884f14a7c5f7baa14e7a9e7100c.tar.bz2
rneovim-4887c3dc1c64d884f14a7c5f7baa14e7a9e7100c.zip
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
-rw-r--r--src/nvim/search.c5
1 files 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;
}