Re: pgsql: Move SHA2 routines to a new generic API layer for crypto hashes

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Move SHA2 routines to a new generic API layer for crypto hashes
Date: 2020-12-02 03:14:33
Message-ID: X8cGmZV/DIIFmptx@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Wed, Dec 02, 2020 at 11:42:58AM +0900, Fujii Masao wrote:
> 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?

Neither gcc nor clang complain on my end, even with
-Werror=maybe-uninitialized, because they understand that the status
will be set anyway as we have no default in the switch? :)

You are right, this is bad practice for those code paths, so let's fix
it. Which version are you using? I'd like to be able to reproduce
that and double-check if there are more missing spots.
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2020-12-02 03:21:16 Re: pgsql: Move SHA2 routines to a new generic API layer for crypto hashes
Previous Message Fujii Masao 2020-12-02 02:42:58 Re: pgsql: Move SHA2 routines to a new generic API layer for crypto hashes