From: Dr. Stephen Henson Date: Wed, 28 Sep 2016 14:18:58 +0000 (+0100) Subject: Print if a STACK is NULL. X-Git-Tag: OpenSSL_1_1_1-pre1~3420 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=73a9f60dd127df9ca05bec7afd835ff7c9bee9ae;p=oweals%2Fopenssl.git Print if a STACK is NULL. If a STACK (corresponding to SEQUENCE OF or SET OF) is NULL then the field is absent as opposed to empty (present but has zero elements). Reviewed-by: Rich Salz --- diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index f53e9056aa..b5698060e8 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -315,7 +315,8 @@ static int asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, pctx)) return 0; } - if (!i && BIO_printf(out, "%*s\n", indent + 2, "") <= 0) + if (i == 0 && BIO_printf(out, "%*s<%s>\n", indent + 2, "", + stack == NULL ? "ABSENT" : "EMPTY") <= 0) return 0; if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_SEQUENCE) { if (BIO_printf(out, "%*s}\n", indent, "") <= 0)