From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Move SHA2 routines to a new generic API layer for crypto hashes
Date: Wed, 2 Dec 2020 11:42:58 +0900
Message-ID: <cee3df00-566a-400c-1252-67c3701f918a@oss.nttdata.com> (raw)
In-Reply-To: <E1kkH9C-0006jA-Ub@gemulon.postgresql.org>
References: <E1kkH9C-0006jA-Ub@gemulon.postgresql.org>
On 2020/12/02 10:41, Michael Paquier wrote:
> Move SHA2 routines to a new generic API layer for crypto hashes
Thanks for improving this!
I got the following compiler failure. ISTM that the variable "status"
in both pg_cryptohash_update() and pg_cryptohash_final() needs
to be initialized with 0. Patch attached. Thought?
cryptohash_openssl.c: In function ‘pg_cryptohash_update’:
cryptohash_openssl.c:144:5: error: ‘status’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (status <= 0)
^
cryptohash_openssl.c: In function ‘pg_cryptohash_final’:
cryptohash_openssl.c:179:5: error: ‘status’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (status <= 0)
^
cc1: all warnings being treated as errors
make[2]: *** [cryptohash_openssl.o] Error 1
<builtin>: recipe for target 'cryptohash_openssl.o' failed
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachments:initialize_status.patch (text/plain, 641B) downloaddiff --git a/src/common/cryptohash_openssl.c b/src/common/cryptohash_openssl.cindex 8e2c69b48b..33f17cac33 100644--- a/src/common/cryptohash_openssl.c+++ b/src/common/cryptohash_openssl.c@@ -119,7 +119,7 @@ pg_cryptohash_init(pg_cryptohash_ctx *ctx)
int
pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len)
{
- int status;+ int status = 0;
if (ctx == NULL)
return 0;
@@ -154,7 +154,7 @@ pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len)
int
pg_cryptohash_final(pg_cryptohash_ctx *ctx, uint8 *dest)
{
- int status;+ int status = 0;
if (ctx == NULL)
return 0;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, michael@paquier.xyz
Subject: Re: pgsql: Move SHA2 routines to a new generic API layer for crypto hashes
In-Reply-To: <cee3df00-566a-400c-1252-67c3701f918a@oss.nttdata.com>
References: <E1kkH9C-0006jA-Ub@gemulon.postgresql.org> <cee3df00-566a-400c-1252-67c3701f918a@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox