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

Commitff030eb

Browse files
committed
Check return of pg_b64_encode() for error
Forgotten in commit761c795.Author: Ranier Vilela <ranier.vf@gmail.com>Discussion:https://www.postgresql.org/message-id/flat/CAEudQAq-3yHsSdWoOOaw%2BgAQYgPMpMGuB5pt2yCXgv-YuxG2Hg%40mail.gmail.com
1 parent965b2cc commitff030eb

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎contrib/postgres_fdw/connection.c‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,23 +559,28 @@ connect_pg_server(ForeignServer *server, UserMapping *user)
559559
if (MyProcPort->has_scram_keys&&UseScramPassthrough(server,user))
560560
{
561561
intlen;
562+
intencoded_len;
562563

563564
keywords[n]="scram_client_key";
564565
len=pg_b64_enc_len(sizeof(MyProcPort->scram_ClientKey));
565566
/* don't forget the zero-terminator */
566567
values[n]=palloc0(len+1);
567-
pg_b64_encode((constchar*)MyProcPort->scram_ClientKey,
568-
sizeof(MyProcPort->scram_ClientKey),
569-
(char*)values[n],len);
568+
encoded_len=pg_b64_encode((constchar*)MyProcPort->scram_ClientKey,
569+
sizeof(MyProcPort->scram_ClientKey),
570+
(char*)values[n],len);
571+
if (encoded_len<0)
572+
elog(ERROR,"could not encode SCRAM client key");
570573
n++;
571574

572575
keywords[n]="scram_server_key";
573576
len=pg_b64_enc_len(sizeof(MyProcPort->scram_ServerKey));
574577
/* don't forget the zero-terminator */
575578
values[n]=palloc0(len+1);
576-
pg_b64_encode((constchar*)MyProcPort->scram_ServerKey,
577-
sizeof(MyProcPort->scram_ServerKey),
578-
(char*)values[n],len);
579+
encoded_len=pg_b64_encode((constchar*)MyProcPort->scram_ServerKey,
580+
sizeof(MyProcPort->scram_ServerKey),
581+
(char*)values[n],len);
582+
if (encoded_len<0)
583+
elog(ERROR,"could not encode SCRAM server key");
579584
n++;
580585
}
581586

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp