1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +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:
Bruce Momjian
2014-04-17 12:37:53 -04:00
parent 234283ecd3
commit a1b9c46300
22 changed files with 81 additions and 68 deletions

View File

@ -85,7 +85,7 @@ void
pgp_cfb_free(PGP_CFB *ctx)
{
px_cipher_free(ctx->ciph);
memset(ctx, 0, sizeof(*ctx));
px_memset(ctx, 0, sizeof(*ctx));
px_free(ctx);
}