From 73a9f60dd127df9ca05bec7afd835ff7c9bee9ae Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 28 Sep 2016 15:18:58 +0100 Subject: [PATCH] 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 --- crypto/asn1/tasn_prn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.25.1