From: Dr. Stephen Henson Date: Mon, 8 Jun 2015 12:23:00 +0000 (+0100) Subject: return correct NID for undefined object X-Git-Tag: OpenSSL_1_0_1n~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3d2c3fa5fc7e1cf119b50c0baf7511d7d75254e1;p=oweals%2Fopenssl.git return correct NID for undefined object Reviewed-by: Tim Hudson (cherry picked from commit 0fb9990480919163cc375a2b6c0df1d8d901a77b) --- diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 5ff1294d3c..aca382a6e9 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -417,6 +417,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 */