diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-02 12:08:16 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-02 12:08:16 +0100 |
commit | af043e12d9e5869c597de40b9a2517ae97ac72e7 (patch) | |
tree | 3d141f1d6710bdcbb634114f54e870dace34fef2 | |
parent | f2ce76a8c0290af35e434e38cfe889ed0fec4c6a (diff) | |
download | vim-git-af043e12d9e5869c597de40b9a2517ae97ac72e7.tar.gz |
patch 9.0.0024: may access part of typeahead buf that isn't filledv9.0.0024
Problem: May access part of typeahead buf that isn't filled.
Solution: Check length of typeahead.
-rw-r--r-- | src/getchar.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c index 210a67aca..12fd1c914 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -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; diff --git a/src/version.c b/src/version.c index fe683f4dd..e8d506c90 100644 --- a/src/version.c +++ b/src/version.c @@ -736,6 +736,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 24, +/**/ 23, /**/ 22, |