Skip to content

Commit 77111e2

Browse files
committed
patch 8.2.3246: memory use after free
Problem: Memory use after free. Solution: When clearing a string option set the pointer to "empty_option".
1 parent 131530a commit 77111e2

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/option.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ free_all_options(void)
807807
else if (options[i].var != VAR_WIN
808808
&& (options[i].flags & P_STRING))
809809
// buffer-local option: free global value
810-
free_string_option(*(char_u **)options[i].var);
810+
clear_string_option((char_u **)options[i].var);
811811
}
812812
}
813813
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3246,
758760
/**/
759761
3245,
760762
/**/

0 commit comments

Comments
 (0)