From fc02b87e2876b2492a3d5eebd3b70be383b08f40 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 17 Apr 2014 12:37:53 -0400 Subject: 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. --- contrib/pgcrypto/pgp-compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/pgcrypto/pgp-compress.c') diff --git a/contrib/pgcrypto/pgp-compress.c b/contrib/pgcrypto/pgp-compress.c index 7a9516b0708..db0c5dbadff 100644 --- a/contrib/pgcrypto/pgp-compress.c +++ b/contrib/pgcrypto/pgp-compress.c @@ -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); } -- cgit v1.2.3