summaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorTom Lane2018-09-08 22:20:36 +0000
committerTom Lane2018-09-08 22:20:36 +0000
commitf47f3148011f1cb5dc34396382fc2f434844d247 (patch)
tree73242df67b3b34f18ddba6447adb7476aa922955 /src/interfaces
parent9226a3b89b004b3472d963442856206f0c249a53 (diff)
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
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/libpq/fe-auth-scram.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-auth-scram.c b/src/interfaces/libpq/fe-auth-scram.c
index 1d9c9371183..603ef4c0020 100644
--- a/src/interfaces/libpq/fe-auth-scram.c
+++ b/src/interfaces/libpq/fe-auth-scram.c
@@ -477,7 +477,7 @@ build_client_final_message(fe_scram_state *state)
printfPQExpBuffer(&conn->errorMessage,
"channel binding not supported by this build\n");
return NULL;
-#endif /* HAVE_PGTLS_GET_PEER_CERTIFICATE_HASH */
+#endif /* HAVE_PGTLS_GET_PEER_CERTIFICATE_HASH */
}
#ifdef HAVE_PGTLS_GET_PEER_CERTIFICATE_HASH
else if (conn->ssl_in_use)
@@ -747,7 +747,7 @@ verify_server_signature(fe_scram_state *state)
char *
pg_fe_scram_build_verifier(const char *password)
{
- char *prep_password = NULL;
+ char *prep_password;
pg_saslprep_rc rc;
char saltbuf[SCRAM_DEFAULT_SALT_LEN];
char *result;