mirror of
https://github.com/ladislav-zezula/StormLib.git
synced 2026-01-18 05:58:19 +01:00
+ Fixed crash when ha == NULL in SFileCreateFile
This commit is contained in:
@@ -685,16 +685,19 @@ bool WINAPI SFileCreateFile(
|
||||
nError = ERROR_INVALID_PARAMETER;
|
||||
|
||||
// Don't allow to add file if the MPQ is open for read only
|
||||
if(ha->dwFlags & MPQ_FLAG_READ_ONLY)
|
||||
nError = ERROR_ACCESS_DENIED;
|
||||
if(nError == ERROR_SUCCESS)
|
||||
{
|
||||
if(ha->dwFlags & MPQ_FLAG_READ_ONLY)
|
||||
nError = ERROR_ACCESS_DENIED;
|
||||
|
||||
// Don't allow to add a file under pseudo-file name
|
||||
if(IsPseudoFileName(szArchivedName, NULL))
|
||||
nError = ERROR_INVALID_PARAMETER;
|
||||
// Don't allow to add a file under pseudo-file name
|
||||
if(IsPseudoFileName(szArchivedName, NULL))
|
||||
nError = ERROR_INVALID_PARAMETER;
|
||||
|
||||
// Don't allow to add any of the internal files
|
||||
if(IsInternalMpqFileName(szArchivedName))
|
||||
nError = ERROR_INTERNAL_FILE;
|
||||
// Don't allow to add any of the internal files
|
||||
if(IsInternalMpqFileName(szArchivedName))
|
||||
nError = ERROR_INTERNAL_FILE;
|
||||
}
|
||||
|
||||
// Perform validity check of the MPQ flags
|
||||
if(nError == ERROR_SUCCESS)
|
||||
|
||||
Reference in New Issue
Block a user