summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/crypt-md5.c
diff options
context:
space:
mode:
authorBruce Momjian2014-04-17 16:37:53 +0000
committerBruce Momjian2014-04-17 16:37:53 +0000
commit9fe55259fd61fd9199907623f974caa7af66e780 (patch)
tree2d2d7fc333474267d375ca35db482b8a4e42e253 /contrib/pgcrypto/crypt-md5.c
parent83defef8c794e7772e4099a7efa2ebac3c62742c (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/crypt-md5.c')
-rw-r--r--contrib/pgcrypto/crypt-md5.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pgcrypto/crypt-md5.c b/contrib/pgcrypto/crypt-md5.c
index 2a5cd70208a..6a09d76989f 100644
--- a/contrib/pgcrypto/crypt-md5.c
+++ b/contrib/pgcrypto/crypt-md5.c
@@ -89,7 +89,7 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
px_md_update(ctx, final, pl > MD5_SIZE ? MD5_SIZE : pl);
/* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof final);
+ px_memset(final, 0, sizeof final);
/* Then something really weird... */
for (i = strlen(pw); i; i >>= 1)
@@ -154,7 +154,7 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
*p = '\0';
/* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof final);
+ px_memset(final, 0, sizeof final);
px_md_free(ctx1);
px_md_free(ctx);