Skip to content

Commit

Permalink
patch 9.0.0024: may access part of typeahead buf that isn't filled
Browse files Browse the repository at this point in the history
Problem:    May access part of typeahead buf that isn't filled.
Solution:   Check length of typeahead.
  • Loading branch information
brammool committed Jul 2, 2022
1 parent f2ce76a commit af043e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/getchar.c
Expand Up @@ -2437,7 +2437,8 @@ handle_mapping(
int is_plug_map = FALSE;

// If typehead starts with <Plug> then remap, even for a "noremap" mapping.
if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
if (typebuf.tb_len >= 3
&& typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
&& typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA
&& typebuf.tb_buf[typebuf.tb_off + 2] == KE_PLUG)
is_plug_map = TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -735,6 +735,8 @@ static char *(features[]) =

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

0 comments on commit af043e1

Please sign in to comment.