1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

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
This commit is contained in:
Peter Eisentraut
2026-09-01 11:58:20 +02:00
parent 5313fc415d
commit 2a2dab67dc

View File

@@ -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>