diff options
author | xkernel <xkernel.wang@foxmail.com> | 2022-07-11 15:21:09 +0800 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-07-13 11:26:30 +1000 |
commit | a0ff8e413e94ba46720a4bf3a5032c50531c526c (patch) | |
tree | 572d6cabb2a7ac9e42c70ef3a27333648bcad6a8 /crypto/objects/obj_dat.c | |
parent | c6e7f427c82dfa17416a39af7661c40162d57aaf (diff) |
add a check for the return of OBJ_new_nid()
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18773)
Diffstat (limited to 'crypto/objects/obj_dat.c')
-rw-r--r-- | crypto/objects/obj_dat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index a430d4e106..7ad55711cf 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; |