AGS: Safety check for asset library v20, for asset name over limit

From upstream 9a2aaae2b3a0799722f1567f97761701afbef584
This commit is contained in:
Paul Gilbert 2021-07-10 13:57:23 -07:00
parent 04d6a41c42
commit a8f4d9dc5b
2 changed files with 3 additions and 0 deletions

View file

@ -258,6 +258,8 @@ MFLUtil::MFLError MFLUtil::ReadV20(AssetLibInfo &lib, Stream *in) {
for (size_t i = 0; i < asset_count; ++i) {
short len = in->ReadInt16();
len /= 5; // CHECKME: why 5?
if (len > MaxAssetFileLen)
return kMFLErrAssetNameLong;
in->Read(fn_buf, len);
// decrypt filenames
DecryptText(fn_buf);