postgres.git / summary / log / commit / refs
commit 2a2dab67dc40a41a003545308423c1d3def02dea
Author: Peter Eisentraut <peter@eisentraut.org>
Date: Tue Sep 01 09:58:20 2026 +0000
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 <sehrope@jackdb.com>
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=<N>