From 92b3975cdb272c000082872aacfe61ab33286b6f Mon Sep 17 00:00:00 2001 From: inoguchi <> Date: Thu, 20 Jan 2022 11:00:34 +0000 Subject: Add check for BIO_indent return value CID 24812 ok jsing@ millert@ tb@ --- src/lib/libcrypto/dh/dh_ameth.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index eaca890a50..0df7fbc739 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_ameth.c,v 1.22 2022/01/10 12:10:26 tb Exp $ */ +/* $OpenBSD: dh_ameth.c,v 1.23 2022/01/20 11:00:34 inoguchi Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -353,7 +353,8 @@ do_dh_print(BIO *bp, const DH *x, int indent, ASN1_PCTX *ctx, int ptype) goto err; } - BIO_indent(bp, indent, 128); + if (!BIO_indent(bp, indent, 128)) + goto err; if (BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0) goto err; indent += 4; @@ -368,7 +369,8 @@ do_dh_print(BIO *bp, const DH *x, int indent, ASN1_PCTX *ctx, int ptype) if (!ASN1_bn_print(bp, "generator:", x->g, m, indent)) goto err; if (x->length != 0) { - BIO_indent(bp, indent, 128); + if (!BIO_indent(bp, indent, 128)) + goto err; if (BIO_printf(bp, "recommended-private-length: %d bits\n", (int)x->length) <= 0) goto err; -- cgit v1.2.3-55-g6feb