Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6f1bf75

Browse files
committed
Fix pg_ctl initdb without options.
Passing NULL string to snprintf is avoided.
1 parent a620d50 commit 6f1bf75

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/pg_ctl/pg_ctl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.116 2009/12/10 06:32:28 petere Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.117 2009/12/15 00:17:50 itagaki Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -656,6 +656,9 @@ do_init(void)
656656
if (exec_path == NULL)
657657
exec_path = find_other_exec_or_die(argv0, "initdb", "initdb (PostgreSQL) " PG_VERSION "\n");
658658

659+
if (pgdata_opt == NULL)
660+
pgdata_opt = "";
661+
659662
if (post_opts == NULL)
660663
post_opts = "";
661664

0 commit comments

Comments
 (0)