summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-03-22 14:33:05 +0000
committerMatt Caswell <matt@openssl.org>2018-03-27 15:57:52 +0100
commit53c9818e970fc0c22d77e19fda3b3e6f6c9e759d (patch)
treea10e11e902cf35062f574d5f18d32a190d2f70c8 /crypto
parentf6c024c2e7f33e9d26c62cf19d519e5ef7fa4a09 (diff)
Don't write out a bad OID
If we don't have OID data for an object then we should fail if we are asked to encode the ASN.1 for that OID. Fixes #5723 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5725)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/tasn_enc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/asn1/tasn_enc.c b/crypto/asn1/tasn_enc.c
index caa48696da..8b562ba1f4 100644
--- a/crypto/asn1/tasn_enc.c
+++ b/crypto/asn1/tasn_enc.c
@@ -528,6 +528,8 @@ static int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
otmp = (ASN1_OBJECT *)*pval;
cont = otmp->data;
len = otmp->length;
+ if (cont == NULL || len == 0)
+ return -1;
break;
case V_ASN1_NULL: