mirror of
https://github.com/neovim/neovim.git
synced 2024-12-25 21:55:17 -07: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:
parent
6964b67c00
commit
3116f870ba
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user