mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
API: Bugfix: Terminate directory string in vim_change_directory
Also check that the string length is not equal or greater than MAXPATHL.
This commit is contained in:
parent
677d30d796
commit
399a0e3740
@ -118,8 +118,14 @@ StringArray vim_list_runtime_paths(void)
|
||||
|
||||
void vim_change_directory(String dir, Error *err)
|
||||
{
|
||||
if (dir.size >= MAXPATHL) {
|
||||
set_api_error("directory string is too long", err);
|
||||
return;
|
||||
}
|
||||
|
||||
char string[MAXPATHL];
|
||||
strncpy(string, dir.data, dir.size);
|
||||
string[dir.size] = NUL;
|
||||
|
||||
try_start();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user