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

Commite41b8a0

Browse files
committed
On further thought, we need a defense against empty PGPORT here too.
1 parent45f9217 commite41b8a0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.157 2000/12/31 18:15:58 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.158 2000/12/31 18:23:21 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -861,7 +861,11 @@ connectDBStart(PGconn *conn)
861861
conn->raddr.sa.sa_family=family;
862862

863863
/* Set port number */
864-
portno=atoi(conn->pgport);
864+
if (conn->pgport!=NULL&&conn->pgport[0]!='\0')
865+
portno=atoi(conn->pgport);
866+
else
867+
portno=DEF_PGPORT;
868+
865869
if (family==AF_INET)
866870
{
867871
conn->raddr.in.sin_port=htons((unsigned short) (portno));
@@ -875,7 +879,6 @@ connectDBStart(PGconn *conn)
875879
}
876880
#endif
877881

878-
879882
/* Open a socket */
880883
if ((conn->sock=socket(family,SOCK_STREAM,0))<0)
881884
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp