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

Commitb3f3092

Browse files
author
Neil Conway
committed
Fix off-by-1 bug in pg_ctl in -D handling, per report from pjmodos@parba.cz
1 parent29a26b2 commitb3f3092

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.48 2004/11/27 18:51:05 tgl Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.49 2004/12/06 01:09:20 neilc Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -1289,10 +1289,10 @@ main(int argc, char **argv)
12891289
{
12901290
case'D':
12911291
{
1292-
char*pgdata_D=xmalloc(strlen(optarg));
1292+
char*pgdata_D;
12931293
char*env_var=xmalloc(strlen(optarg)+8);
12941294

1295-
strcpy(pgdata_D,optarg);
1295+
pgdata_D=xstrdup(optarg);
12961296
canonicalize_path(pgdata_D);
12971297
snprintf(env_var,strlen(optarg)+8,"PGDATA=%s",
12981298
pgdata_D);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp