pgsql: pgcrypto: fix memset() calls that might be optimized away

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: pgcrypto: fix memset() calls that might be optimized away
Date: 2014-04-17 16:38:09
Message-ID: E1WapKD-0006QJ-6i@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/a1b9c46300e2a24478f480c63ec2c53c3e53acef

Modified Files
--------------
contrib/pgcrypto/crypt-blowfish.c | 6 +++---
contrib/pgcrypto/crypt-md5.c | 4 ++--
contrib/pgcrypto/fortuna.c | 15 ++++++++-------
contrib/pgcrypto/internal-sha2.c | 8 ++++----
contrib/pgcrypto/internal.c | 10 +++++-----
contrib/pgcrypto/mbuf.c | 12 ++++++------
contrib/pgcrypto/openssl.c | 4 ++--
contrib/pgcrypto/pgp-cfb.c | 2 +-
contrib/pgcrypto/pgp-compress.c | 4 ++--
contrib/pgcrypto/pgp-decrypt.c | 19 ++++++++++---------
contrib/pgcrypto/pgp-encrypt.c | 10 +++++-----
contrib/pgcrypto/pgp-mpi.c | 2 +-
contrib/pgcrypto/pgp-pgsql.c | 6 +++---
contrib/pgcrypto/pgp-pubenc.c | 6 +++---
contrib/pgcrypto/pgp-pubkey.c | 8 ++++----
contrib/pgcrypto/pgp-s2k.c | 3 +++
contrib/pgcrypto/pgp.c | 2 +-
contrib/pgcrypto/px-crypt.c | 2 +-
contrib/pgcrypto/px-hmac.c | 8 ++++----
contrib/pgcrypto/px.c | 8 +++++++-
contrib/pgcrypto/px.h | 1 +
contrib/pgcrypto/sha2.c | 9 +++++----
22 files changed, 81 insertions(+), 68 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-04-17 20:13:16 pgsql: Fix unused-variable warning on Windows.
Previous Message Bruce Momjian 2014-04-17 16:38:08 pgsql: pgcrypto: fix memset() calls that might be optimized away