Skip to content

Commit af043e1

Browse files
committed
patch 9.0.0024: may access part of typeahead buf that isn't filled
Problem: May access part of typeahead buf that isn't filled. Solution: Check length of typeahead.
1 parent f2ce76a commit af043e1

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/getchar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,8 @@ handle_mapping(
24372437
int is_plug_map = FALSE;
24382438

24392439
// If typehead starts with <Plug> then remap, even for a "noremap" mapping.
2440-
if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
2440+
if (typebuf.tb_len >= 3
2441+
&& typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
24412442
&& typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA
24422443
&& typebuf.tb_buf[typebuf.tb_off + 2] == KE_PLUG)
24432444
is_plug_map = TRUE;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ static char *(features[]) =
735735

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
24,
738740
/**/
739741
23,
740742
/**/

0 commit comments

Comments
 (0)