From a0ff8e413e94ba46720a4bf3a5032c50531c526c Mon Sep 17 00:00:00 2001 From: xkernel Date: Mon, 11 Jul 2022 15:21:09 +0800 Subject: [PATCH] add a check for the return of OBJ_new_nid() Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/18773) --- crypto/objects/obj_dat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index a430d4e1063..7ad55711cfa 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -758,6 +758,9 @@ int OBJ_create(const char *oid, const char *sn, const char *ln) } tmpoid->nid = OBJ_new_nid(1); + if (tmpoid->nid == NID_undef) + goto err; + tmpoid->sn = (char *)sn; tmpoid->ln = (char *)ln; -- 2.47.3