summaryrefslogtreecommitdiffstats
path: root/crypto/ffc
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-24 04:16:24 +0200
committerShane Lontis <shane.lontis@oracle.com>2020-09-05 07:41:31 +0200
commit776cf98b493768de02f798f71f6b30c40deb3506 (patch)
treed066fb87ad98b889868c5d86af1943a46ff57669 /crypto/ffc
parentFix coverity CID #1465967 & #1465968 - fix NULL dereference in dh_ameth.c (diff)
downloadopenssl-776cf98b493768de02f798f71f6b30c40deb3506.tar.xz
openssl-776cf98b493768de02f798f71f6b30c40deb3506.zip
Fix coverity CID #1457935 - Check return value in ffc_params.c for BIO_indent/BIO_puts calls.
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/12708)
Diffstat (limited to 'crypto/ffc')
-rw-r--r--crypto/ffc/ffc_params.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/ffc/ffc_params.c b/crypto/ffc/ffc_params.c
index ac767c0a1c..c980ea0018 100644
--- a/crypto/ffc/ffc_params.c
+++ b/crypto/ffc/ffc_params.c
@@ -313,8 +313,10 @@ int ffc_params_print(BIO *bp, const FFC_PARAMS *ffc, int indent)
goto err;
if (ffc->seed != NULL) {
size_t i;
- BIO_indent(bp, indent, 128);
- BIO_puts(bp, "seed:");
+
+ if (!BIO_indent(bp, indent, 128)
+ || BIO_puts(bp, "seed:") <= 0)
+ goto err;
for (i = 0; i < ffc->seedlen; i++) {
if ((i % 15) == 0) {
if (BIO_puts(bp, "\n") <= 0
@@ -329,8 +331,8 @@ int ffc_params_print(BIO *bp, const FFC_PARAMS *ffc, int indent)
return 0;
}
if (ffc->pcounter != -1) {
- BIO_indent(bp, indent, 128);
- if (BIO_printf(bp, "counter: %d\n", ffc->pcounter) <= 0)
+ if (!BIO_indent(bp, indent, 128)
+ || BIO_printf(bp, "counter: %d\n", ffc->pcounter) <= 0)
goto err;
}
return 1;