summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/objects/obj_dat.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/openssl/openssl/crypto/objects/obj_dat.c')
-rw-r--r--deps/openssl/openssl/crypto/objects/obj_dat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/deps/openssl/openssl/crypto/objects/obj_dat.c b/deps/openssl/openssl/crypto/objects/obj_dat.c
index 5cd755d77d..aca382a6e9 100644
--- a/deps/openssl/openssl/crypto/objects/obj_dat.c
+++ b/deps/openssl/openssl/crypto/objects/obj_dat.c
@@ -400,6 +400,8 @@ static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
j = (a->length - b->length);
if (j)
return (j);
+ if (a->length == 0)
+ return 0;
return (memcmp(a->data, b->data, a->length));
}
@@ -415,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 */