Skip to content
Snippets Groups Projects
Commit 095858e5 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Set size to MAX_PATH+1 when allocating.

On Win32, size is explcitly "ignored" when target is NULL, so we
should set it to the size of the allocation.
parent b8d0ef97
No related branches found
No related tags found
No related merge requests found
Pipeline #5382 passed
......@@ -1008,7 +1008,8 @@ char * _fullpath(char *target, const char *path, size_t size) {
bool target_alloced=false;
if(target==NULL) {
if((target=malloc(MAX_PATH+1))==NULL) {
size = MAX_PATH + 1;
if((target=malloc(size))==NULL) {
return(NULL);
}
target_alloced=true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment