]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4399: crash after ml_get error v8.2.4399
authorBram Moolenaar <Bram@vim.org>
Wed, 16 Feb 2022 16:33:28 +0000 (16:33 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 16 Feb 2022 16:33:28 +0000 (16:33 +0000)
Problem:    Crash after ml_get error.
Solution:   When returning "???" flush the line and set ml_line_lnum.

src/memline.c
src/version.c

index c18109aefe8b7d240fabd487897295120575fde9..9c15fa7743b15087235011e3d961a918d080c9e7 100644 (file)
@@ -2619,9 +2619,12 @@ ml_get_buf(
            siemsg(_(e_ml_get_invalid_lnum_nr), lnum);
            --recursive;
        }
+       ml_flush_line(buf);
+       buf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
 errorret:
        STRCPY(questions, "???");
        buf->b_ml.ml_line_len = 4;
+       buf->b_ml.ml_line_lnum = lnum;
        return questions;
     }
     if (lnum <= 0)                     // pretend line 0 is line 1
index 4bfca872c5121d1c96657166d570e16ca1029daf..4f17acffd4c0c51ab7e6311882d79ba66a2f49e1 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4399,
 /**/
     4398,
 /**/