summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/tasn_prn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/tasn_prn.c')
-rw-r--r--src/lib/libcrypto/asn1/tasn_prn.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_prn.c b/src/lib/libcrypto/asn1/tasn_prn.c
index b8f7dd5294..9fbf177ba4 100644
--- a/src/lib/libcrypto/asn1/tasn_prn.c
+++ b/src/lib/libcrypto/asn1/tasn_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_prn.c,v 1.17 2018/04/25 11:48:21 tb Exp $ */ 1/* $OpenBSD: tasn_prn.c,v 1.18 2019/03/23 18:48:14 beck Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -507,7 +507,12 @@ asn1_primitive_print(BIO *out, ASN1_VALUE **fld, const ASN1_ITEM *it,
507 return 0; 507 return 0;
508 if (pf && pf->prim_print) 508 if (pf && pf->prim_print)
509 return pf->prim_print(out, fld, it, indent, pctx); 509 return pf->prim_print(out, fld, it, indent, pctx);
510
510 str = (ASN1_STRING *)*fld; 511 str = (ASN1_STRING *)*fld;
512
513 if (str->length < 0)
514 return 0;
515
511 if (it->itype == ASN1_ITYPE_MSTRING) 516 if (it->itype == ASN1_ITYPE_MSTRING)
512 utype = str->type & ~V_ASN1_NEG; 517 utype = str->type & ~V_ASN1_NEG;
513 else 518 else
@@ -516,7 +521,6 @@ asn1_primitive_print(BIO *out, ASN1_VALUE **fld, const ASN1_ITEM *it,
516 ASN1_TYPE *atype = (ASN1_TYPE *)*fld; 521 ASN1_TYPE *atype = (ASN1_TYPE *)*fld;
517 utype = atype->type; 522 utype = atype->type;
518 fld = &atype->value.asn1_value; 523 fld = &atype->value.asn1_value;
519 str = (ASN1_STRING *)*fld;
520 if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE) 524 if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE)
521 pname = NULL; 525 pname = NULL;
522 else 526 else