pgsql: pgcrypto: fix memset() calls that might be optimized away - Mailing list pgsql-committers

From Bruce Momjian
Subject pgsql: pgcrypto: fix memset() calls that might be optimized away
Date
Msg-id E1WapKC-0006Q7-U3@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: pgcrypto: fix memset() calls that might be optimized away
Next
From: Bruce Momjian
Date:
Subject: pgsql: pgcrypto: fix memset() calls that might be optimized away