提交 487a73de 编写于 作者: F Frank Morgner 提交者: Rich Salz

Added error checking for OBJ_create

fixes segmentation fault in case of not enough memory for object creation

CLA: trivial
Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3157)
上级 a105d560
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册