return correct NID for undefined object

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 0fb9990480)
This commit is contained in:
Dr. Stephen Henson 2015-06-08 13:23:00 +01:00
parent bb82db1c77
commit 228806a4f3

View file

@ -415,6 +415,9 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
if (a->nid != 0)
return (a->nid);
if (a->length == 0)
return NID_undef;
if (added != NULL) {
ad.type = ADDED_DATA;
ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */