Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a0dec7

Browse files
committed
Require hostname to be set when using GSSAPI authentication. Without it,
the GSSAPI libraries crash. Noted by Zdenek Kotala
1 parent 6c6ee75 commit 2a0dec7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/interfaces/libpq/fe-auth.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.143 2010/01/02 16:58:11 momjian Exp $
10+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.144 2010/03/08 10:01:12 mha Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -426,6 +426,12 @@ pg_GSS_startup(PGconn *conn)
426426
int maxlen;
427427
gss_buffer_desc temp_gbuf;
428428

429+
if (!conn->pghost)
430+
{
431+
printfPQExpBuffer(&conn->errorMessage, libpq_gettext("host name must be specified\n"));
432+
return STATUS_ERROR;
433+
}
434+
429435
if (conn->gctx)
430436
{
431437
printfPQExpBuffer(&conn->errorMessage,

0 commit comments

Comments
 (0)