From 2a2dab67dc40a41a003545308423c1d3def02dea Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 1 Sep 2026 11:58:20 +0200 Subject: [PATCH] Fix memset invocation It was setting sha_buf_tmp but sizing it by sizeof sha_buf. These happen to be the same size, so it's not an actual problem, but for correctness make the sizeof match. Reported-by: Sehrope Sarkuni Discussion: https://www.postgresql.org/message-id/flat/a035c67f-4aa8-42e0-bb24-7b5abe927af4%40eisentraut.org --- contrib/pgcrypto/crypt-sha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pgcrypto/crypt-sha.c b/contrib/pgcrypto/crypt-sha.c index 8191ba02b23..8d42d3e427d 100644 --- a/contrib/pgcrypto/crypt-sha.c +++ b/contrib/pgcrypto/crypt-sha.c @@ -477,7 +477,7 @@ px_crypt_shacrypt(const char *pw, const char *salt, char *passwd, unsigned dstle memcpy(cp, sha_buf_tmp, block); /* Make sure we don't leave something important behind */ - px_memset(&sha_buf_tmp, 0, sizeof sha_buf); + px_memset(&sha_buf_tmp, 0, sizeof sha_buf_tmp); /*- * 21. Repeat a loop according to the number specified in the rounds=