mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-18 19:12:44 +03:00
fix(util): SFile::Open() should set to nullptr even in the case of a failure
This commit is contained in:
parent
1be8d5539c
commit
6a06eb16e7
@ -125,6 +125,7 @@ int32_t SFile::OpenEx(SArchive* archive, const char* filename, uint32_t flags, S
|
||||
|
||||
// Overflow protection
|
||||
if (SStrLen(filename) + 1 > STORM_MAX_PATH) {
|
||||
*file = nullptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -146,6 +147,7 @@ int32_t SFile::OpenEx(SArchive* archive, const char* filename, uint32_t flags, S
|
||||
filetype = SFILE_PAQ;
|
||||
filehandle = static_cast<void*>(handle);
|
||||
} else {
|
||||
*file = nullptr;
|
||||
// could not open either plain or MPQ archived file
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user