]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0135: bracketed paste can still cause invalid memory access v8.2.0135
authorBram Moolenaar <Bram@vim.org>
Mon, 20 Jan 2020 20:12:20 +0000 (21:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 20 Jan 2020 20:12:20 +0000 (21:12 +0100)
Problem:    Bracketed paste can still cause invalid memory access. (Dominique
            Pelle)
Solution:   Check for NULL pointer.

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

index f2ae425fab1c9396ccfef080a21706600e1cf514..70b8fee129067899a2bd25b285c16dcaaa841ddc 100644 (file)
@@ -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;
index 60152f602b63d31759b63403f3b3807224e4e24a..89ca6e1314c8e53c2adb02344f92452f110f7c47 100644 (file)
@@ -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
index de6f9f012d2e51a09e06a0813d0e7cd0679ef3cc..acffb43d8f08e6a6d1982b7f792ff138893befdd 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    135,
 /**/
     134,
 /**/