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

Commit1ad6878

Browse files
committed
Revert patch that removed BUFSIZ usage. The memory has to hold the
structures plus pointers used by the structure.
1 parentdd67707 commit1ad6878

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.92 2004/09/27 23:38:45 momjian Exp $
13+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.93 2004/09/28 00:06:02 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -749,7 +749,7 @@ fe_getauthname(char *PQerrormsg)
749749
if (GetUserName(username,&namesize))
750750
name=username;
751751
#else
752-
charpwdbuf[sizeof(structpasswd)];
752+
charpwdbuf[BUFSIZ];
753753
structpasswdpwdstr;
754754
structpasswd*pw=NULL;
755755

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.53 2004/09/27 23:38:45 momjian Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.54 2004/09/28 00:06:02 momjian Exp $
1515
*
1616
* NOTES
1717
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
@@ -512,7 +512,7 @@ verify_peer(PGconn *conn)
512512

513513
{
514514
structhostenthpstr;
515-
charbuf[sizeof(structhostent)];
515+
charbuf[BUFSIZ];
516516
intherrno=0;
517517

518518
/*
@@ -598,7 +598,7 @@ load_dh_file(int keylength)
598598
#ifdefWIN32
599599
returnNULL;
600600
#else
601-
charpwdbuf[sizeof(structpasswd)];
601+
charpwdbuf[BUFSIZ];
602602
structpasswdpwdstr;
603603
structpasswd*pwd=NULL;
604604
FILE*fp;
@@ -745,7 +745,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
745745
#ifdefWIN32
746746
return0;
747747
#else
748-
charpwdbuf[sizeof(structpasswd)];
748+
charpwdbuf[BUFSIZ];
749749
structpasswdpwdstr;
750750
structpasswd*pwd=NULL;
751751
structstatbuf,
@@ -952,7 +952,7 @@ initialize_SSL(PGconn *conn)
952952
{
953953
#ifndefWIN32
954954
structstatbuf;
955-
charpwdbuf[sizeof(structpasswd)];
955+
charpwdbuf[BUFSIZ];
956956
structpasswdpwdstr;
957957
structpasswd*pwd=NULL;
958958
charfnbuf[MAXPGPATH];

‎src/port/getaddrinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2003, PostgreSQL Global Development Group
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.14 2004/09/27 23:39:14 momjian Exp $
15+
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.15 2004/09/28 00:07:01 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -85,7 +85,7 @@ getaddrinfo(const char *node, const char *service,
8585

8686
#ifdefFRONTEND
8787
structhostenthpstr;
88-
charbuf[sizeof(structhostent)];
88+
charbuf[BUFSIZ];
8989
intherrno=0;
9090

9191
pqGethostbyname(node,&hpstr,buf,sizeof(buf),

‎src/port/thread.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
99
*
10-
* $PostgreSQL: pgsql/src/port/thread.c,v 1.27 2004/09/27 23:39:14 momjian Exp $
10+
* $PostgreSQL: pgsql/src/port/thread.c,v 1.28 2004/09/28 00:07:01 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -103,13 +103,15 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
103103
/* POSIX version */
104104
getpwuid_r(uid,resultbuf,buffer,buflen,result);
105105
#else
106+
106107
/*
107108
* Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
108109
* getpwuid_r(uid, resultbuf, buffer, buflen)
109110
*/
110111
*result=getpwuid_r(uid,resultbuf,buffer,buflen);
111112
#endif
112113
#else
114+
113115
/* no getpwuid_r() available, just use getpwuid() */
114116
*result=getpwuid(uid);
115117
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp