diff options
author | Bruce Momjian <bruce@momjian.us> | 2014-04-17 12:37:53 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2014-04-17 12:37:53 -0400 |
commit | 9fe55259fd61fd9199907623f974caa7af66e780 (patch) | |
tree | 2d2d7fc333474267d375ca35db482b8a4e42e253 /contrib/pgcrypto/openssl.c | |
parent | 83defef8c794e7772e4099a7efa2ebac3c62742c (diff) | |
download | postgresql-9fe55259fd61fd9199907623f974caa7af66e780.tar.gz postgresql-9fe55259fd61fd9199907623f974caa7af66e780.zip |
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/openssl.c')
-rw-r--r-- | contrib/pgcrypto/openssl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c index 86c0fb04b85..068bf3469e0 100644 --- a/contrib/pgcrypto/openssl.c +++ b/contrib/pgcrypto/openssl.c @@ -142,7 +142,7 @@ EVP_MD_CTX_init(EVP_MD_CTX *ctx) static int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) { - memset(ctx, 0, sizeof(*ctx)); + px_memset(ctx, 0, sizeof(*ctx)); return 1; } @@ -381,7 +381,7 @@ gen_ossl_free(PX_Cipher *c) { ossldata *od = (ossldata *) c->ptr; - memset(od, 0, sizeof(*od)); + px_memset(od, 0, sizeof(*od)); px_free(od); px_free(c); } |