summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/pgp-pubenc.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2014-04-17 12:37:53 -0400
committerBruce Momjian <bruce@momjian.us>2014-04-17 12:37:53 -0400
commitfc02b87e2876b2492a3d5eebd3b70be383b08f40 (patch)
tree19301491c363e8f87b15d53f1f742b5975161749 /contrib/pgcrypto/pgp-pubenc.c
parent179c45ae2fb9519a343bc2e38ebe4609097d14af (diff)
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.
Diffstat (limited to 'contrib/pgcrypto/pgp-pubenc.c')
-rw-r--r--contrib/pgcrypto/pgp-pubenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pgcrypto/pgp-pubenc.c b/contrib/pgcrypto/pgp-pubenc.c
index 943d2e49f57..0d1be7d2b78 100644
--- a/contrib/pgcrypto/pgp-pubenc.c
+++ b/contrib/pgcrypto/pgp-pubenc.c
@@ -73,7 +73,7 @@ pad_eme_pkcs1_v15(uint8 *data, int data_len, int res_len, uint8 **res_p)
if (res < 0)
{
- memset(buf, 0, res_len);
+ px_memset(buf, 0, res_len);
px_free(buf);
return res;
}
@@ -123,10 +123,10 @@ create_secmsg(PGP_Context *ctx, PGP_MPI **msg_p, int full_bytes)
if (padded)
{
- memset(padded, 0, full_bytes);
+ px_memset(padded, 0, full_bytes);
px_free(padded);
}
- memset(secmsg, 0, klen + 3);
+ px_memset(secmsg, 0, klen + 3);
px_free(secmsg);
if (res >= 0)