+ Fixed crash when ha == NULL in SFileCreateFile

This commit is contained in:
Ladislav
2014-01-12 13:04:30 +01:00
parent 8bf322b611
commit a70a980022
2 changed files with 14 additions and 8 deletions

View File

@@ -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)