commit | 77111e2bfc7316eb6b1e653386cef6441af806f8 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Thu Jul 29 21:11:30 2021 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Thu Jul 29 21:11:30 2021 +0200 |
tree | c18b172c37a824e31fe89560ea47e36f62f7b5f7 | |
parent | 131530a54d0f72b820b027606231744e3a09b9ef [diff] [blame] |
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".
diff --git a/src/option.c b/src/option.c index 182ff34..decba50 100644 --- a/src/option.c +++ b/src/option.c
@@ -807,7 +807,7 @@ 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); } } #endif