rdpdr: Fix potential null pointer access

This commit is contained in:
Martin Fleisz 2023-08-02 13:27:32 +02:00 committed by akallabeth
parent cd06e7179a
commit 45ee30da5e

View File

@ -154,7 +154,7 @@ static BOOL drive_file_set_fullpath(DRIVE_FILE* file, WCHAR* fullpath)
const WCHAR sep[] = { PathGetSeparatorW(PATH_STYLE_NATIVE), '\0' }; const WCHAR sep[] = { PathGetSeparatorW(PATH_STYLE_NATIVE), '\0' };
WCHAR* filename = _wcsrchr(file->fullpath, *sep); WCHAR* filename = _wcsrchr(file->fullpath, *sep);
if (_wcsncmp(filename, sep, ARRAYSIZE(sep)) == 0) if (filename && _wcsncmp(filename, sep, ARRAYSIZE(sep)) == 0)
*filename = '\0'; *filename = '\0';
return TRUE; return TRUE;