Skip to content

Commit be0e1c8

Browse files
committed
Fix null or empty input string in COM_LoadFile (FS_Open with input empty string "" will succeed on some POSIX systems)
Resolved #919
1 parent 3dc9f8c commit be0e1c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rehlds/engine/common.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,9 @@ int EXT_FUNC COM_FileSize(const char *filename)
19951995

19961996
unsigned char* EXT_FUNC COM_LoadFile(const char *path, int usehunk, int *pLength)
19971997
{
1998+
if (!path || !path[0])
1999+
return NULL;
2000+
19982001
char base[MAX_PATH];
19992002
unsigned char *buf = NULL;
20002003

0 commit comments

Comments
 (0)