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

Commit205b5c2

Browse files
committed
A little paranoia never hurt anyone.
1 parentc0e9dc1 commit205b5c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/utils/misc/database.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.49 2001/10/25 05:49:51 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.50 2002/05/05 17:50:04 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -222,8 +222,10 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path)
222222
/* Found it; extract the OID and the database path. */
223223
*db_id=tup.t_data->t_oid;
224224
pathlen=VARSIZE(&(tup_db->datpath))-VARHDRSZ;
225+
if (pathlen<0)
226+
pathlen=0;/* pure paranoia */
225227
if (pathlen >=MAXPGPATH)
226-
pathlen=MAXPGPATH-1;/*pure paranoia */
228+
pathlen=MAXPGPATH-1;/*more paranoia */
227229
strncpy(path,VARDATA(&(tup_db->datpath)),pathlen);
228230
path[pathlen]='\0';
229231
gotodone;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp