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:08
Message-ID: E1WapKC-0006Q7-U3@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
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9fe55259fd61fd9199907623f974caa7af66e780

Modified Files
--------------
contrib/pgcrypto/crypt-blowfish.c | 5 +++--
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 | 2 ++
contrib/pgcrypto/sha2.c | 9 +++++----
22 files changed, 82 insertions(+), 67 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2014-04-17 16:38:09 pgsql: pgcrypto: fix memset() calls that might be optimized away
Previous Message Bruce Momjian 2014-04-17 15:56:04 pgsql: report stat() error in trigger file check