summaryrefslogtreecommitdiffstats
path: root/crypto/objects
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-06-08 13:23:00 +0100
committerDr. Stephen Henson <steve@openssl.org>2015-06-08 21:46:42 +0100
commit34cdff92e97b3d65e8f1b6d60779107c99d3a931 (patch)
treeb537c31e57b3ce58f36120014c0aa83902d35d0b /crypto/objects
parent05627d57e55517eae21c251fe287760bd1137218 (diff)
return correct NID for undefined object
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 0fb9990480919163cc375a2b6c0df1d8d901a77b)
Diffstat (limited to 'crypto/objects')
-rw-r--r--crypto/objects/obj_dat.c3
1 files changed, 3 insertions, 0 deletions
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 */