diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-20 21:12:20 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-20 21:12:20 +0100 |
commit | fe4bbac1166f2e4e3fa18cb966ec7305198c8176 (patch) | |
tree | 7dd1957be67664265dbf6dfc9c33834757def74c | |
parent | 8ba6bb7c94229f1e6f85ea5152ed8b4fbbbd9d20 (diff) | |
download | vim-git-fe4bbac1166f2e4e3fa18cb966ec7305198c8176.tar.gz |
patch 8.2.0135: bracketed paste can still cause invalid memory accessv8.2.0135
Problem: Bracketed paste can still cause invalid memory access. (Dominique
Pelle)
Solution: Check for NULL pointer.
-rw-r--r-- | src/edit.c | 2 | ||||
-rw-r--r-- | src/testdir/test_search.vim | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c index f2ae425fa..70b8fee12 100644 --- a/src/edit.c +++ b/src/edit.c @@ -4942,7 +4942,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) int save_paste = p_paste; // If the end code is too long we can't detect it, read everything. - if (STRLEN(end) >= NUMBUFLEN) + if (end != NULL && STRLEN(end) >= NUMBUFLEN) end = NULL; ++no_mapping; allow_keys = 0; diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 60152f602..89ca6e131 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -1451,6 +1451,7 @@ func Test_searchdecl() endfunc func Test_search_special() - " this was causing illegal memory access + " this was causing illegal memory access and an endless loop + set t_PE= exe "norm /\x80PS" endfunc diff --git a/src/version.c b/src/version.c index de6f9f012..acffb43d8 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 135, +/**/ 134, /**/ 133, |