From 83e47e0252eefd1bf8ba44a60b164360c9334c29 Mon Sep 17 00:00:00 2001 From: olszomal Date: Tue, 7 Feb 2023 14:36:44 +0100 Subject: [PATCH] Specify the maximum NumberOfSections value --- osslsigncode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osslsigncode.c b/osslsigncode.c index 7a7ced6..08bce7d 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -1594,7 +1594,7 @@ static u_char *pe_calc_page_hash(char *indata, uint32_t header_size, BIO *bhash; /* NumberOfSections indicates the size of the section table, - * which immediately follows the headers. */ + * which immediately follows the headers, can be up to 65535 under Vista and later */ nsections = GET_UINT16_LE(indata + header_size + 6); if (nsections == 0 || nsections > UINT16_MAX) { printf("Corrupted number of sections: 0x%08X\n", nsections);