From 95615faf1d0a0f7f1633608b6fb946dd13760cd0 Mon Sep 17 00:00:00 2001 From: olszomal Date: Fri, 15 Jul 2022 15:37:23 +0200 Subject: [PATCH] check PE file size --- osslsigncode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osslsigncode.c b/osslsigncode.c index 8894303..1070e8c 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -3536,8 +3536,8 @@ static int pe_verify_header(char *indata, char *infile, uint32_t filesize, FILE_ printf("Unexpected SizeOfHeaders field: 0x%08X\n", header->header_size); return 0; /* FAILED */ } - if (filesize < header->header_size + 160) { - printf("Corrupt DOS file - too short: %s\n", infile); + if (filesize < header->header_size + 176) { + printf("Corrupt PE file - too short: %s\n", infile); return 0; /* FAILED */ } if (memcmp(indata + header->header_size, "PE\0\0", 4)) {