1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +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 179c45ae2f
commit fc02b87e28
22 changed files with 81 additions and 68 deletions

View File

@ -175,7 +175,7 @@ compress_free(void *priv)
struct ZipStat *st = priv;
deflateEnd(&st->stream);
memset(st, 0, sizeof(*st));
px_memset(st, 0, sizeof(*st));
px_free(st);
}
@ -298,7 +298,7 @@ decompress_free(void *priv)
struct DecomprData *dec = priv;
inflateEnd(&dec->stream);
memset(dec, 0, sizeof(*dec));
px_memset(dec, 0, sizeof(*dec));
px_free(dec);
}