]> granicus.if.org Git - postgresql/commit
Minor cleanup/future-proofing for pg_saslprep().
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 8 Sep 2018 22:20:36 +0000 (18:20 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 8 Sep 2018 22:20:36 +0000 (18:20 -0400)
commitf47f3148011f1cb5dc34396382fc2f434844d247
tree73242df67b3b34f18ddba6447adb7476aa922955
parent9226a3b89b004b3472d963442856206f0c249a53
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
src/backend/libpq/auth-scram.c
src/common/saslprep.c
src/interfaces/libpq/fe-auth-scram.c