diff options
author | Ladislav Zezula <zezula@volny.cz> | 2025-09-15 15:15:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-15 15:15:33 +0200 |
commit | d1aef907ffd8ea6f6ce04c5495b1cd350afc932a (patch) | |
tree | d7648d47f2f735e9b181919b77eb0e2c30d2a551 /src/SBaseFileTable.cpp | |
parent | 249b1c0490af45965ac5e75e138b80b8699da665 (diff) | |
parent | 49b619bae28ba5fcb63c192ef14a9b624e2a7286 (diff) |
Fixed https://github.com/ladislav-zezula/StormLib/issues/397 and http…
Diffstat (limited to 'src/SBaseFileTable.cpp')
-rw-r--r-- | src/SBaseFileTable.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SBaseFileTable.cpp b/src/SBaseFileTable.cpp index e854ac0..46daab5 100644 --- a/src/SBaseFileTable.cpp +++ b/src/SBaseFileTable.cpp @@ -2508,7 +2508,8 @@ TMPQHetTable * LoadHetTable(TMPQArchive * ha) TMPQHeader * pHeader = ha->pHeader;
// If the HET table position is not 0, we expect the table to be present
- if(pHeader->HetTablePos64 && pHeader->HetTableSize64)
+ // Alsom the HET table must have a reasonable size
+ if(pHeader->HetTablePos64 && pHeader->HetTableSize64 && pHeader->HetTableSize64 < BET_TABLE_MAX_SIZE)
{
// Attempt to load the HET table (Hash Extended Table)
pExtTable = LoadExtTable(ha, pHeader->HetTablePos64, (size_t)pHeader->HetTableSize64, HET_TABLE_SIGNATURE, MPQ_KEY_HASH_TABLE);
@@ -2530,7 +2531,7 @@ TMPQBetTable * LoadBetTable(TMPQArchive * ha) TMPQHeader * pHeader = ha->pHeader;
// If the BET table position is not 0, we expect the table to be present
- if(pHeader->BetTablePos64 && pHeader->BetTableSize64)
+ if(pHeader->BetTablePos64 && pHeader->BetTableSize64 && pHeader->BetTableSize64 < BET_TABLE_MAX_SIZE)
{
// Attempt to load the HET table (Hash Extended Table)
pExtTable = LoadExtTable(ha, pHeader->BetTablePos64, (size_t)pHeader->BetTableSize64, BET_TABLE_SIGNATURE, MPQ_KEY_BLOCK_TABLE);
|