From 14f01ee73a576509e4364dd0b3939c6be188a81e Mon Sep 17 00:00:00 2001 From: inoguchi Date: Thu, 20 Jan 2022 11:06:24 +0000 Subject: [PATCH] Add check for BIO_indent return value CID 24778 ok jsing@ millert@ tb@ --- lib/libcrypto/evp/p_lib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index 89ce4c451a2..cdd38e4e30d 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.27 2021/12/12 21:30:13 tb Exp $ */ +/* $OpenBSD: p_lib.c,v 1.28 2022/01/20 11:06:24 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -526,7 +526,8 @@ EVP_PKEY_free_it(EVP_PKEY *x) static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr) { - BIO_indent(out, indent, 128); + if (!BIO_indent(out, indent, 128)) + return 0; BIO_printf(out, "%s algorithm \"%s\" unsupported\n", kstr, OBJ_nid2ln(pkey->type)); return 1; -- 2.20.1