From ff9a6d35935368e4ec999eae1e5c73ef7475d3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Trojnara?= Date: Fri, 20 Jun 2025 10:26:08 +0200 Subject: [PATCH] Check for invalid OID in is_content_type --- helpers.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helpers.c b/helpers.c index 013083d..6c3bf4f 100644 --- a/helpers.c +++ b/helpers.c @@ -474,6 +474,10 @@ int is_content_type(PKCS7 *p7, const char *objid) int ret; indir_objid = OBJ_txt2obj(objid, 1); + if (!indir_objid) { + fprintf(stderr, "Invalid object identifier: %s\n", objid); + return 0; /* FAILED */ + } ret = p7 && PKCS7_type_is_signed(p7) && !OBJ_cmp(p7->d.sign->contents->type, indir_objid) && (p7->d.sign->contents->d.other->type == V_ASN1_SEQUENCE ||