aboutsummaryrefslogtreecommitdiff
path: root/src/SFileGetFileInfo.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2024-04-21 21:45:52 +0200
committerLadislav Zezula <zezula@volny.cz>2024-04-21 21:45:52 +0200
commit0f8c306a3e9dfa536e97e9e0678773c40ea13a52 (patch)
tree44068fd3ef6d7cf08843ec310ef85502e195758b /src/SFileGetFileInfo.cpp
parent4e09d09686df70efc1c16c2bb41f716c6ce4fca4 (diff)
Fixed page fault from https://github.com/ladislav-zezula/StormLib/issues/344
Diffstat (limited to 'src/SFileGetFileInfo.cpp')
-rw-r--r--src/SFileGetFileInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/SFileGetFileInfo.cpp b/src/SFileGetFileInfo.cpp
index 5dd997d..1746fa0 100644
--- a/src/SFileGetFileInfo.cpp
+++ b/src/SFileGetFileInfo.cpp
@@ -452,6 +452,8 @@ bool WINAPI SFileGetFileInfo(
return GetInfo(pvFileInfo, cbFileInfo, &hf->dwFileKey, sizeof(DWORD), pcbLengthNeeded);
case SFileInfoEncryptionKeyRaw:
+ if(pFileEntry == NULL)
+ return GetInfo_ReturnError(ERROR_INVALID_PARAMETER);
dwInt32Value = hf->dwFileKey;
if(pFileEntry->dwFlags & MPQ_FILE_KEY_V2)
dwInt32Value = (dwInt32Value ^ pFileEntry->dwFileSize) - (DWORD)hf->MpqFilePos;