From 20fc0519af073374506b7a2cf4c452c1a9d62146 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 1 Aug 2021 10:45:01 -0400 Subject: [PATCH] vim-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". https://github.com/vim/vim/commit/77111e2bfc7316eb6b1e653386cef6441af806f8 --- src/nvim/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index 95970a77f8..b40ecd22c8 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -770,7 +770,7 @@ void free_all_options(void) } } else if (options[i].var != VAR_WIN && (options[i].flags & P_STRING)) { // buffer-local option: free global value - free_string_option(*(char_u **)options[i].var); + clear_string_option((char_u **)options[i].var); } } }