mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Add NULL checks to FILESYSTEM_loadFileToMemory()
FILESYSTEM_loadFileToMemory() dereferenced pointers without checking if they were valid... I don't know of any cases where they could have been NULL, but better safe than sorry.
This commit is contained in:
parent
3ebdc1da89
commit
1191f425b3
1 changed files with 5 additions and 0 deletions
|
@ -451,6 +451,11 @@ void FILESYSTEM_loadFileToMemory(
|
||||||
PHYSFS_sint64 length;
|
PHYSFS_sint64 length;
|
||||||
PHYSFS_sint64 success;
|
PHYSFS_sint64 success;
|
||||||
|
|
||||||
|
if (name == NULL || mem == NULL)
|
||||||
|
{
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (SDL_strcmp(name, "levels/special/stdin.vvvvvv") == 0)
|
if (SDL_strcmp(name, "levels/special/stdin.vvvvvv") == 0)
|
||||||
{
|
{
|
||||||
// this isn't *technically* necessary when piping directly from a file, but checking for that is annoying
|
// this isn't *technically* necessary when piping directly from a file, but checking for that is annoying
|
||||||
|
|
Loading…
Reference in a new issue