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".
77111e2bfc
This commit is contained in:
Jan Edmund Lazo 2021-08-01 10:45:01 -04:00
parent 5e4fcc8b36
commit 20fc0519af
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -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);
}
}
}