From: Frank Morgner Date: Mon, 10 Apr 2017 12:15:09 +0000 (+0200) Subject: Added error checking for OBJ_create X-Git-Tag: OpenSSL_1_1_1-pre1~1808 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=487a73def65aa6ffedf5baf353e912fe61aa3c7c;p=oweals%2Fopenssl.git Added error checking for OBJ_create fixes segmentation fault in case of not enough memory for object creation CLA: trivial Reviewed-by: Richard Levitte Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3157) --- diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index f37e947f30..2f86cd5e46 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -691,6 +691,8 @@ int OBJ_create(const char *oid, const char *sn, const char *ln) /* Convert numerical OID string to an ASN1_OBJECT structure */ tmpoid = OBJ_txt2obj(oid, 1); + if (tmpoid == NULL) + return 0; /* If NID is not NID_undef then object already exists */ if (OBJ_obj2nid(tmpoid) != NID_undef) {