Navigation Menu

Skip to content

Commit

Permalink
patch 8.2.5120: searching for quotes may go over the end of the line
Browse files Browse the repository at this point in the history
Problem:    Searching for quotes may go over the end of the line.
Solution:   Check for running into the NUL.
  • Loading branch information
brammool committed Jun 18, 2022
1 parent 2ff7e7e commit 2f074f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/textobject.c
Expand Up @@ -1798,11 +1798,17 @@ current_quote(

// Find out if we have a quote in the selection.
while (i <= col_end)
{
// check for going over the end of the line, which can happen if
// the line was changed after the Visual area was selected.
if (line[i] == NUL)
break;
if (line[i++] == quotechar)
{
selected_quote = TRUE;
break;
}
}
}

if (!vis_empty && line[col_start] == quotechar)
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5120,
/**/
5119,
/**/
Expand Down

0 comments on commit 2f074f4

Please sign in to comment.