aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-03-11 19:41:01 +0000
committerMatt Caswell <matt@openssl.org>2015-03-12 09:22:19 +0000
commit34a7ed0c39aa3ab67eea1e106577525eaf0d7a00 (patch)
tree757fba3bef4121183ea0da2bdd9699baa3cc4bac /crypto/asn1
parent9e488fd6ab2c295941e91a47ab7bcd346b7540c7 (diff)
downloadopenssl-34a7ed0c39aa3ab67eea1e106577525eaf0d7a00.tar.gz
Fix asn1_item_print_ctx
The call to asn1_do_adb can return NULL on error, so we should check the return value before attempting to use it. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/tasn_prn.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c
index 94e220be69..2626de9728 100644
--- a/crypto/asn1/tasn_prn.c
+++ b/crypto/asn1/tasn_prn.c
@@ -285,6 +285,8 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
const ASN1_TEMPLATE *seqtt;
seqtt = asn1_do_adb(fld, tt, 1);
+ if(!seqtt)
+ return 0;
tmpfld = asn1_get_field_ptr(fld, seqtt);
if (!asn1_template_print_ctx(out, tmpfld,
indent + 2, seqtt, pctx))