pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Minor cleanup/future-proofing for pg_saslprep().
Date: Sat, 08 Sep 2018 22:20:55 +0000
Message-ID: <E1fylb5-00007u-UU@gemulon.postgresql.org> (raw)

Minor cleanup/future-proofing for pg_saslprep().

Ensure that pg_saslprep() initializes its output argument to NULL in
all failure paths, and then remove the redundant initialization that
some (not all) of its callers did.  This does not fix any live bug,
but it reduces the odds of future bugs of omission.

Also add a comment about why the existing failure-path coding is
adequate.

Back-patch so as to keep the function's API consistent across branches,
again to forestall future bug introduction.

Patch by me, reviewed by Michael Paquier

Discussion: https://postgr.es/m/16558.1536407783@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/86d226ae5a3607b8bbde2487f821b8f8807da1c8

Modified Files
--------------
src/backend/libpq/auth-scram.c       |  4 ++--
src/common/saslprep.c                | 11 ++++++++---
src/interfaces/libpq/fe-auth-scram.c |  4 ++--
3 files changed, 12 insertions(+), 7 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1fylb5-00007u-UU@gemulon.postgresql.org>
Permalink:  ../E1fylb5-00007u-UU@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fylb5-00007u-UU@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Minor cleanup/future-proofing for pg_saslprep().
  In-Reply-To: <E1fylb5-00007u-UU@gemulon.postgresql.org>
  References: <E1fylb5-00007u-UU@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox