mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.4925: trailing backslash may cause reading past end of line (#18493)
Problem: Trailing backslash may cause reading past end of line. Solution: Check for NUL after backslash.53a70289c2
N/A patches for version.c: vim-patch:8.2.4926: #ifdef for crypt feature around too many lines Problem: #ifdef for crypt feature around too many lines. Solution: Move code outside of #ifdef. (closes vim/vim#10388)51f0bc31d3
This commit is contained in:
parent
f0135d9cd9
commit
8658e82357
@ -3969,6 +3969,9 @@ static int find_next_quote(char_u *line, int col, int quotechar, char_u *escape)
|
|||||||
return -1;
|
return -1;
|
||||||
} else if (escape != NULL && vim_strchr(escape, c)) {
|
} else if (escape != NULL && vim_strchr(escape, c)) {
|
||||||
col++;
|
col++;
|
||||||
|
if (line[col] == NUL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
} else if (c == quotechar) {
|
} else if (c == quotechar) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -188,10 +188,18 @@ func Test_string_html_objects()
|
|||||||
call assert_equal("<div><div\nattr=\"attr\"\n></div></div>", @", e)
|
call assert_equal("<div><div\nattr=\"attr\"\n></div></div>", @", e)
|
||||||
|
|
||||||
set quoteescape&
|
set quoteescape&
|
||||||
|
|
||||||
|
" this was going beyond the end of the line
|
||||||
|
%del
|
||||||
|
sil! norm i"\
|
||||||
|
sil! norm i"\
|
||||||
|
sil! norm i"\
|
||||||
|
call assert_equal('"\', getline(1))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
set enc=utf-8
|
set enc=utf-8
|
||||||
bwipe!
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_empty_html_tag()
|
func Test_empty_html_tag()
|
||||||
|
Loading…
Reference in New Issue
Block a user