Skip to content

Commit ff9a6d3

Browse files
committed
Check for invalid OID in is_content_type
1 parent e81b08e commit ff9a6d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

helpers.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ int is_content_type(PKCS7 *p7, const char *objid)
474474
int ret;
475475

476476
indir_objid = OBJ_txt2obj(objid, 1);
477+
if (!indir_objid) {
478+
fprintf(stderr, "Invalid object identifier: %s\n", objid);
479+
return 0; /* FAILED */
480+
}
477481
ret = p7 && PKCS7_type_is_signed(p7) &&
478482
!OBJ_cmp(p7->d.sign->contents->type, indir_objid) &&
479483
(p7->d.sign->contents->d.other->type == V_ASN1_SEQUENCE ||

0 commit comments

Comments
 (0)