Skip to content

Commit b3f3092

Browse files
author
Neil Conway
committed
Fix off-by-1 bug in pg_ctl in -D handling, per report from pjmodos@parba.cz
1 parent 29a26b2 commit b3f3092

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy