forked from aniani/vim
patch 8.2.4925: trailing backslash may cause reading past end of line
Problem: Trailing backslash may cause reading past end of line. Solution: Check for NUL after backslash.
This commit is contained in:
@@ -185,10 +185,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()
|
||||||
|
@@ -1664,7 +1664,11 @@ find_next_quote(
|
|||||||
if (c == NUL)
|
if (c == NUL)
|
||||||
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;
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
|
@@ -746,6 +746,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 */
|
||||||
|
/**/
|
||||||
|
4925,
|
||||||
/**/
|
/**/
|
||||||
4924,
|
4924,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user