Fix uninitialised data if the result is NULL.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2017-09-26 18:27:38 +01:00
parent 4873e1f020
commit 8f92e63f45

View file

@ -150,7 +150,11 @@ DWORD GetFileAttributes(const char * filename)
DWORD GetFullPathName(const char* filename, DWORD length, char * buffer, char ** filePart)
{
realpath(filename, buffer);
const char * result = realpath(filename, buffer);
if (!result)
{
*buffer = 0;
}
return strlen(buffer);
}