]> granicus.if.org Git - vim/commitdiff
patch 8.1.0581: double free without the text properties feature v8.1.0581
authorBram Moolenaar <Bram@vim.org>
Thu, 13 Dec 2018 22:16:36 +0000 (23:16 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 Dec 2018 22:16:36 +0000 (23:16 +0100)
Problem:    Double free without the text properties feature.
Solution:   Reset the dirty flag.

src/memline.c
src/version.c

index 59e4502601ce14f7fdc5ce2ddd2017835642544c..0eb31c3c5c5bd9b5b37661690c1c8bf88257eefe 100644 (file)
@@ -3176,9 +3176,9 @@ ml_replace_len(linenr_T lnum, char_u *line_arg, colnr_T len_arg, int copy)
     {
        // another line is buffered, flush it
        ml_flush_line(curbuf);
+       curbuf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
 
 #ifdef FEAT_TEXT_PROP
-       curbuf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
        if (has_any_text_properties(curbuf))
            // Need to fetch the old line to copy over any text properties.
            ml_get_buf(curbuf, lnum, TRUE);
index 9f097afa411adb14e60557ff02812d9c7e2502e2..9a44976f0f3fd0e5b007cf2e1fd8be77ec081e24 100644 (file)
@@ -799,6 +799,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    581,
 /**/
     580,
 /**/