From: inoguchi Date: Thu, 20 Jan 2022 11:00:34 +0000 (+0000) Subject: Add check for BIO_indent return value X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7cd40e1cb8dc64bc778686797aee20c72511b75a;p=openbsd Add check for BIO_indent return value CID 24812 ok jsing@ millert@ tb@ --- diff --git a/lib/libcrypto/dh/dh_ameth.c b/lib/libcrypto/dh/dh_ameth.c index eaca890a50b..0df7fbc7391 100644 --- a/lib/libcrypto/dh/dh_ameth.c +++ b/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;