mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
pgcrypto: fix memset() calls that might be optimized away
Specifically, on-stack memset() might be removed, so: * Replace memset() with px_memset() * Add px_memset to copy_crlf() * Add px_memset to pgp-s2k.c Patch by Marko Kreen Report by PVS-Studio Backpatch through 8.4.
This commit is contained in:
@ -71,7 +71,7 @@ pgp_mpi_free(PGP_MPI *mpi)
|
||||
{
|
||||
if (mpi == NULL)
|
||||
return 0;
|
||||
memset(mpi, 0, sizeof(*mpi) + mpi->bytes);
|
||||
px_memset(mpi, 0, sizeof(*mpi) + mpi->bytes);
|
||||
px_free(mpi);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user