From 5e064233a3e39186dae43f81d0fc03ca92d8c9d1 Mon Sep 17 00:00:00 2001 From: olszomal Date: Mon, 9 Nov 2020 13:00:43 +0100 Subject: [PATCH] increase the maximum size of supported CAT files --- osslsigncode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osslsigncode.c b/osslsigncode.c index 500dd45..9f2b192 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -4800,7 +4800,9 @@ static int get_file_type(char *indata, char *infile, file_type_t *type) gsf_init(); gsf_initialized = 1; #endif - } else if (!memcmp(indata+4, pkcs7_signed_data, sizeof(pkcs7_signed_data))) { + } else if (!memcmp(indata + ((GET_UINT8_LE(indata+1) == 0x82) ? 4 : 5), + pkcs7_signed_data, sizeof(pkcs7_signed_data))) { + /* the maximum size of a supported cat file is (2^24 -1) bytes */ *type = FILE_TYPE_CAT; } else { printf("Unrecognized file type: %s\n", infile);