Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2c97f73

Browse files
committed
Fix bogus order of error checks in new channel_binding code.
Coverity pointed out that it's pretty silly to check for a null pointerafter we've already dereferenced the pointer. To fix, just swap theorder of the two error checks. Oversight in commitd6e612f.
1 parent92f1545 commit2c97f73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/interfaces/libpq/fe-auth.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,18 +502,18 @@ pg_SASL_init(PGconn *conn, int payloadlen)
502502
selected_mechanism=SCRAM_SHA_256_NAME;
503503
}
504504

505-
if (conn->channel_binding[0]=='r'&&/* require */
506-
strcmp(selected_mechanism,SCRAM_SHA_256_PLUS_NAME)!=0)
505+
if (!selected_mechanism)
507506
{
508507
printfPQExpBuffer(&conn->errorMessage,
509-
libpq_gettext("channel binding is required, butserver did not offer anauthenticationmethod that supports channel binding\n"));
508+
libpq_gettext("none of theserver's SASLauthenticationmechanisms are supported\n"));
510509
gotoerror;
511510
}
512511

513-
if (!selected_mechanism)
512+
if (conn->channel_binding[0]=='r'&&/* require */
513+
strcmp(selected_mechanism,SCRAM_SHA_256_PLUS_NAME)!=0)
514514
{
515515
printfPQExpBuffer(&conn->errorMessage,
516-
libpq_gettext("none of theserver's SASLauthenticationmechanisms are supported\n"));
516+
libpq_gettext("channel binding is required, butserver did not offer anauthenticationmethod that supports channel binding\n"));
517517
gotoerror;
518518
}
519519

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp