]> granicus.if.org Git - vim/commitdiff
patch 8.2.3674: when ml_get_buf() fails it messes up IObuff v8.2.3674
authorBram Moolenaar <Bram@vim.org>
Thu, 25 Nov 2021 13:52:37 +0000 (13:52 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 25 Nov 2021 13:52:37 +0000 (13:52 +0000)
Problem:    When ml_get_buf() fails it messes up IObuff.
Solution:   Return a local pointer. (closes #9214)

src/memline.c
src/version.c

index f54a970cc6a2f1f24e201bc74acd4f637debbc5e..119861e5d744a3f6f42ccec030f8112bf793414f 100644 (file)
@@ -2606,6 +2606,7 @@ ml_get_buf(
     bhdr_T     *hp;
     DATA_BL    *dp;
     static int recursive = 0;
+    static char_u questions[4];
 
     if (lnum > buf->b_ml.ml_line_count)        // invalid line number
     {
@@ -2618,9 +2619,9 @@ ml_get_buf(
            --recursive;
        }
 errorret:
-       STRCPY(IObuff, "???");
+       STRCPY(questions, "???");
        buf->b_ml.ml_line_len = 4;
-       return IObuff;
+       return questions;
     }
     if (lnum <= 0)                     // pretend line 0 is line 1
        lnum = 1;
index 3f831037365b0cf5bc177e89f607a4dfae573be6..6d96d432473e12699e0254e602484ab88c8dff05 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3674,
 /**/
     3673,
 /**/