Skip to content

Commit

Permalink
Fix null or empty input string in COM_LoadFile (FS_Open with input em…
Browse files Browse the repository at this point in the history
…pty string "" will succeed on some POSIX systems)

Resolved #919
  • Loading branch information
s1lentq committed May 25, 2022
1 parent 3dc9f8c commit be0e1c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rehlds/engine/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,9 @@ int EXT_FUNC COM_FileSize(const char *filename)

unsigned char* EXT_FUNC COM_LoadFile(const char *path, int usehunk, int *pLength)
{
if (!path || !path[0])
return NULL;

char base[MAX_PATH];
unsigned char *buf = NULL;

Expand Down

0 comments on commit be0e1c8

Please sign in to comment.