Add check for BIO_indent return value
authorinoguchi <inoguchi@openbsd.org>
Thu, 20 Jan 2022 11:06:24 +0000 (11:06 +0000)
committerinoguchi <inoguchi@openbsd.org>
Thu, 20 Jan 2022 11:06:24 +0000 (11:06 +0000)
CID 24778

ok jsing@ millert@ tb@

lib/libcrypto/evp/p_lib.c

index 89ce4c4..cdd38e4 100644 (file)
@@ -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;