From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sehrope Sarkuni <sehrope@jackdb.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Replace px_memset() with explicit_bzero()
Date: Tue, 25 Aug 2026 09:20:52 -0400
Message-ID: <618198.1787664052@sss.pgh.pa.us> (raw)
In-Reply-To: <CAH7T-aqZE9O+9YK8CPzcuFjOu_1wBxjhnjNR_MAFiunQDYZ06g@mail.gmail.com>
References: <a035c67f-4aa8-42e0-bb24-7b5abe927af4@eisentraut.org>
<BEA9F53A-125E-4CD0-8016-54D3F3AB2B6E@yesql.se>
<CAH7T-aqZE9O+9YK8CPzcuFjOu_1wBxjhnjNR_MAFiunQDYZ06g@mail.gmail.com>
Sehrope Sarkuni <sehrope@jackdb.com> writes:
> One thing stood out, but it's from the existing code:
> - px_memset(&sha_buf_tmp, 0, sizeof sha_buf);
> + explicit_bzero(&sha_buf_tmp, sizeof sha_buf);
> That's sha_buf in the sizeof but we're zeroing out sha_buf_tmp.
+1 for fixing that. Also I think project style is to write sizeof
with parens.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, sehrope@jackdb.com, daniel@yesql.se, peter@eisentraut.org
Subject: Re: Replace px_memset() with explicit_bzero()
In-Reply-To: <618198.1787664052@sss.pgh.pa.us>
References: <a035c67f-4aa8-42e0-bb24-7b5abe927af4@eisentraut.org> <BEA9F53A-125E-4CD0-8016-54D3F3AB2B6E@yesql.se> <CAH7T-aqZE9O+9YK8CPzcuFjOu_1wBxjhnjNR_MAFiunQDYZ06g@mail.gmail.com> <618198.1787664052@sss.pgh.pa.us>
* 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