1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2020-01-20 20:22:30 +01:00
parent ca33eb256e
commit 98a336dd49
3 changed files with 9 additions and 2 deletions

View File

@@ -4959,9 +4959,9 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
do do
c = vgetc(); c = vgetc();
while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR); 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 // 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; break;
if (has_mbyte) if (has_mbyte)

View File

@@ -1449,3 +1449,8 @@ func Test_searchdecl()
bwipe! bwipe!
endfunc endfunc
func Test_search_special()
" this was causing illegal memory access
exe "norm /\x80PS"
endfunc

View File

@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
133,
/**/ /**/
132, 132,
/**/ /**/