Skip to content
Permalink
Browse files

patch 8.2.0133: invalid memory access with search command

Problem:    Invalid memory access with search command.
Solution:   When :normal runs out of characters in bracketed paste mode break
            out of the loop.(closes #5511)
  • Loading branch information
brammool committed Jan 20, 2020
1 parent ca33eb2 commit 98a336dd497d3422e7efeef9f24cc9e25aeb8a49
Showing with 9 additions and 2 deletions.
  1. +2 −2 src/edit.c
  2. +5 −0 src/testdir/test_search.vim
  3. +2 −0 src/version.c
@@ -4959,9 +4959,9 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
do
c = vgetc();
while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
if (c == NUL || got_int)
if (c == NUL || got_int || (ex_normal_busy > 0 && c == Ctrl_C))
// When CTRL-C was encountered the typeahead will be flushed and we
// won't get the end sequence.
// won't get the end sequence. Except when using ":normal".
break;

if (has_mbyte)
@@ -1449,3 +1449,8 @@ func Test_searchdecl()

bwipe!
endfunc

func Test_search_special()
" this was causing illegal memory access
exe "norm /\x80PS"
endfunc
@@ -742,6 +742,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
133,
/**/
132,
/**/

0 comments on commit 98a336d

Please sign in to comment.
You can’t perform that action at this time.