coverity 1201462: check error returns
authorPauli <paul.dale@oracle.com>
Mon, 6 Jan 2020 01:23:21 +0000 (11:23 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 7 Jan 2020 04:02:52 +0000 (14:02 +1000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10760)

crypto/evp/p_lib.c

index 9999636cfd2e6166afb5fe6e09adf3c75f95656b..59cadb4aad1143f091ca92113775fb5893c86ad8 100644 (file)
@@ -694,10 +694,9 @@ static int print_set_indent(BIO **out, int *pop_f_prefix, long *saved_indent,
 static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent,
                      const char *kstr)
 {
-    BIO_indent(out, indent, 128);
-    BIO_printf(out, "%s algorithm \"%s\" unsupported\n",
-               kstr, OBJ_nid2ln(pkey->type));
-    return 1;
+    return BIO_indent(out, indent, 128)
+        && BIO_printf(out, "%s algorithm \"%s\" unsupported\n",
+                      kstr, OBJ_nid2ln(pkey->type)) > 0;
 }
 
 static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent,