From 9fe55259fd61fd9199907623f974caa7af66e780 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.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/pgcrypto/pgp.c') diff --git a/contrib/pgcrypto/pgp.c b/contrib/pgcrypto/pgp.c index 059c04af8f1..027b467d554 100644 --- a/contrib/pgcrypto/pgp.c +++ b/contrib/pgcrypto/pgp.c @@ -224,7 +224,7 @@ pgp_free(PGP_Context *ctx) { if (ctx->pub_key) pgp_key_free(ctx->pub_key); - memset(ctx, 0, sizeof *ctx); + px_memset(ctx, 0, sizeof *ctx); px_free(ctx); return 0; } -- cgit v1.2.3