From: inoguchi Date: Thu, 20 Jan 2022 11:18:49 +0000 (+0000) Subject: Add check for OBJ_nid2obj return value X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2adc4aa25f938e05dae5f754202ae3171abc3f57;p=openbsd Add check for OBJ_nid2obj return value input from tb@ --- diff --git a/lib/libcrypto/pkcs12/p12_init.c b/lib/libcrypto/pkcs12/p12_init.c index 7ae8d635bcd..13dbe3664a2 100644 --- a/lib/libcrypto/pkcs12/p12_init.c +++ b/lib/libcrypto/pkcs12/p12_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_init.c,v 1.12 2022/01/20 11:15:39 inoguchi Exp $ */ +/* $OpenBSD: p12_init.c,v 1.13 2022/01/20 11:18:49 inoguchi Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -74,7 +74,8 @@ PKCS12_init(int mode) } if (!ASN1_INTEGER_set(pkcs12->version, 3)) goto err; - pkcs12->authsafes->type = OBJ_nid2obj(mode); + if ((pkcs12->authsafes->type = OBJ_nid2obj(mode)) == NULL) + goto err; switch (mode) { case NID_pkcs7_data: if (!(pkcs12->authsafes->d.data =