Mask the name index instead

The maximum number of import libraries (32) is already asserted
This commit is contained in:
x1nixmzeng
2016-01-09 02:43:29 +00:00
parent 7e4fdf7669
commit 06f259c87d
3 changed files with 3 additions and 4 deletions

View File

@@ -479,7 +479,7 @@ void UserModule::Dump() {
for (uint32_t l = 0; l < library_count; l++) {
auto library = reinterpret_cast<const xex2_import_library*>(
libraries + library_offset);
auto name = string_table[library->name_index % library_count];
auto name = string_table[library->name_index & 0xFF];
sb.AppendFormat(" %s - %d imports\n", name,
(uint16_t)library->count);