]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0133: invalid memory access with search command v8.2.0133
authorBram Moolenaar <Bram@vim.org>
Mon, 20 Jan 2020 19:22:30 +0000 (20:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 20 Jan 2020 19:22:30 +0000 (20:22 +0100)
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)

src/edit.c
src/testdir/test_search.vim
src/version.c

index 8160fe56930ace1d393a4081f58fd3789412f108..f2ae425fab1c9396ccfef080a21706600e1cf514 100644 (file)
@@ -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)
index 5030deea97cf4085f7758a250ba9b403e3cb91d3..60152f602b63d31759b63403f3b3807224e4e24a 100644 (file)
@@ -1449,3 +1449,8 @@ func Test_searchdecl()
 
   bwipe!
 endfunc
+
+func Test_search_special()
+  " this was causing illegal memory access
+  exe "norm /\x80PS"
+endfunc
index 2fb0fc3067c173336b0421abd3bf9949a4368573..6b905515437aebf6bbf44f8cd93b3ea8a44aee50 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    133,
 /**/
     132,
 /**/