From 228806a4f3c42cfb304b974a267a95f7a12cba87 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 8 Jun 2015 13:23:00 +0100 Subject: [PATCH] return correct NID for undefined object Reviewed-by: Tim Hudson (cherry picked from commit 0fb9990480919163cc375a2b6c0df1d8d901a77b) --- crypto/objects/obj_dat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index e42a1c147d..454733db89 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -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 */ -- 2.25.1