mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-12-25 07:14:50 +01:00
Add explicit 0-length check out of paranoia
This commit is contained in:
parent
609d71437f
commit
d69cb55c21
|
@ -246,6 +246,11 @@ ESStatus GetESStatus()
|
|||
// Read a temporary buffer of the entire file contents
|
||||
fseek(_fInput, 0, SEEK_END);
|
||||
size_t length = ftell(_fInput);
|
||||
|
||||
// Hard-stop on Empty out of paranoia
|
||||
if (length == 0)
|
||||
return result;
|
||||
|
||||
char* temporaryBuffer = (char*)malloc(length);
|
||||
fseek(_fInput, 0, SEEK_SET);
|
||||
fread(temporaryBuffer, length, 1, _fInput);
|
||||
|
|
Loading…
Reference in New Issue
Block a user