mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 14:26:07 +00:00
coverity/161195: Increase scope of exe_name
Since exe_name is a stack allocated array, we need it to be in scope for the lifetime that vim_path points to it.
This commit is contained in:
@@ -615,9 +615,9 @@ char *vim_getenv(const char *name)
|
|||||||
vim_path = (char *)p_hf;
|
vim_path = (char *)p_hf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char exe_name[MAXPATHL];
|
||||||
// Find runtime path relative to the nvim binary: ../share/nvim/runtime
|
// Find runtime path relative to the nvim binary: ../share/nvim/runtime
|
||||||
if (vim_path == NULL) {
|
if (vim_path == NULL) {
|
||||||
char exe_name[MAXPATHL];
|
|
||||||
size_t exe_name_len = MAXPATHL;
|
size_t exe_name_len = MAXPATHL;
|
||||||
if (os_exepath(exe_name, &exe_name_len) == 0) {
|
if (os_exepath(exe_name, &exe_name_len) == 0) {
|
||||||
char *path_end = (char *)path_tail_with_sep((char_u *)exe_name);
|
char *path_end = (char *)path_tail_with_sep((char_u *)exe_name);
|
||||||
|
Reference in New Issue
Block a user