]> granicus.if.org Git - vim/commitdiff
patch 8.0.0975: using freed memory when setting 'backspace' v8.0.0975
authorBram Moolenaar <Bram@vim.org>
Sun, 20 Aug 2017 14:11:51 +0000 (16:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 20 Aug 2017 14:11:51 +0000 (16:11 +0200)
Problem:    Using freed memory when setting 'backspace'.
Solution:   When changing oldval also change origval.

src/option.c
src/version.c

index 48106411f31a0ce157a3bbdbe3069c7a64710018..61d35798346756b3807318c02d5e6dc0f363dcc9 100644 (file)
@@ -4927,6 +4927,8 @@ do_set(
                                        break;
                                }
                                vim_free(oldval);
+                               if (origval == oldval)
+                                   origval = *(char_u **)varp;
                                oldval = *(char_u **)varp;
                            }
                            /*
index d5df161533353cdac095c78bae970bc09aa24211..36af20968590758de6a4bc4da206af38789c3528 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    975,
 /**/
     974,
 /**/