Skip to content

Commit 226a895

Browse files
committed
Fixing crash that would occur when a dll's import table was not filled out which is structurally valid
1 parent 8b9f5ba commit 226a895

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mono/metadata/metadata-verify.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,10 @@ verify_import_table (VerifyContext *ctx)
622622
const char *ptr = ctx->data + offset;
623623
guint32 name_rva, ilt_rva, iat_rva;
624624

625+
// Having no import table is structurally valid
626+
if (it.rva == 0 && it.size == 0)
627+
return;
628+
625629
g_assert (offset != INVALID_OFFSET);
626630

627631
if (it.size < 40)

0 commit comments

Comments
 (0)