From: Matt Caswell Date: Wed, 11 Mar 2015 19:41:01 +0000 (+0000) Subject: Fix asn1_item_print_ctx X-Git-Tag: OpenSSL_1_0_2a~35 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=15919ecadc3ba9fc210472b806e6ac258825ea83;p=oweals%2Fopenssl.git 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 (cherry picked from commit 34a7ed0c39aa3ab67eea1e106577525eaf0d7a00) --- diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 11d784ccd5..4866dcd193 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -289,6 +289,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))