aboutsummaryrefslogtreecommitdiff
path: root/src/SFileGetFileInfo.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avast.com>2021-05-11 16:39:21 +0200
committerLadislav Zezula <ladislav.zezula@avast.com>2021-05-11 16:39:21 +0200
commit1e9f1cb3218b3ce8cca7683966234bc19647ef6d (patch)
treea1ecd444045ceb3fcfcc4633604b1503558ed2e3 /src/SFileGetFileInfo.cpp
parent398f9b7f404f4c82165859b04a5eb5116a2cf028 (diff)
User data is returned only if there are any, actually
Diffstat (limited to 'src/SFileGetFileInfo.cpp')
-rw-r--r--src/SFileGetFileInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/SFileGetFileInfo.cpp b/src/SFileGetFileInfo.cpp
index 97610b2..ff1a479 100644
--- a/src/SFileGetFileInfo.cpp
+++ b/src/SFileGetFileInfo.cpp
@@ -233,9 +233,13 @@ bool WINAPI SFileGetFileInfo(
return GetInfo(pvFileInfo, cbFileInfo, &ha->UserDataPos, sizeof(ULONGLONG), pcbLengthNeeded);
case SFileMpqUserDataHeader:
+ if(ha->pUserData == NULL)
+ return GetInfo_ReturnError(ERROR_INVALID_PARAMETER);
return GetInfo_ReadFromFile(pvFileInfo, cbFileInfo, ha->pStream, ha->UserDataPos, sizeof(TMPQUserData), pcbLengthNeeded);
case SFileMpqUserData:
+ if(ha->pUserData == NULL)
+ return GetInfo_ReturnError(ERROR_INVALID_PARAMETER);
return GetInfo_ReadFromFile(pvFileInfo, cbFileInfo, ha->pStream, ha->UserDataPos + sizeof(TMPQUserData), ha->pUserData->dwHeaderOffs - sizeof(TMPQUserData), pcbLengthNeeded);
case SFileMpqHeaderOffset: