From e1c7a02aa830a8c6c5ce5f87f3ca53d08f31fec2 Mon Sep 17 00:00:00 2001 From: olszomal Date: Mon, 3 Jun 2024 08:39:20 +0200 Subject: [PATCH] Fixed to get CAT content value --- cat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cat.c b/cat.c index 2f2e40c..aed8c88 100644 --- a/cat.c +++ b/cat.c @@ -285,6 +285,11 @@ static int cat_sign_ms_ctl_content(PKCS7 *p7, PKCS7 *contents) u_char *content; int seqhdrlen, content_length; + if (!contents->d.other || !contents->d.other->value.sequence + || !contents->d.other->value.sequence->data) { + printf("Failed to get content value\n"); + return 0; /* FAILED */ + } seqhdrlen = asn1_simple_hdr_len(contents->d.other->value.sequence->data, contents->d.other->value.sequence->length); content = contents->d.other->value.sequence->data + seqhdrlen;