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 | fc72e94a13026b86a06c7f5c670f4c16420d3d77 (patch) | |
tree | 0572054c47891b08d2e47a3223a09eea87f2b46c /contrib/pgcrypto/pgp-pgsql.c | |
parent | 071d9f085089f3fbae1b472debd38c555cd4a436 (diff) | |
download | postgresql-fc72e94a13026b86a06c7f5c670f4c16420d3d77.tar.gz postgresql-fc72e94a13026b86a06c7f5c670f4c16420d3d77.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/pgp-pgsql.c')
-rw-r--r-- | contrib/pgcrypto/pgp-pgsql.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pgcrypto/pgp-pgsql.c b/contrib/pgcrypto/pgp-pgsql.c index d4eec03cc77..828f64a84bc 100644 --- a/contrib/pgcrypto/pgp-pgsql.c +++ b/contrib/pgcrypto/pgp-pgsql.c @@ -87,7 +87,7 @@ add_block_entropy(PX_MD *md, text *data) px_add_entropy(sha1, 20); - memset(sha1, 0, 20); + px_memset(sha1, 0, 20); } /* @@ -129,7 +129,7 @@ add_entropy(text *data1, text *data2, text *data3) add_block_entropy(md, data3); px_md_free(md); - memset(rnd, 0, sizeof(rnd)); + px_memset(rnd, 0, sizeof(rnd)); } /* @@ -167,7 +167,7 @@ convert_to_utf8(text *src) static void clear_and_pfree(text *p) { - memset(p, 0, VARSIZE(p)); + px_memset(p, 0, VARSIZE(p)); pfree(p); } |