aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-07-10 23:29:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-07-10 23:29:16 +0000
commit5dfd5063e242ccea2ba3fc70c19f5f84f9f8402c (patch)
tree5c982a7a7fd7da2a57d1f6bbcdcc1772cd87cb66
parent99b225c528a3f082f60fd5974e1b44ee0462a6fd (diff)
downloadpostgresql-5dfd5063e242ccea2ba3fc70c19f5f84f9f8402c.tar.gz
postgresql-5dfd5063e242ccea2ba3fc70c19f5f84f9f8402c.zip
Defend against overrun of ExtraOptions array --- strictly paranoia,
since the person or script starting the postmaster has to be trusted anyway.
-rw-r--r--src/backend/postmaster/postmaster.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 5d908807b9d..ee934711ff7 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.405 2004/06/24 21:02:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.406 2004/07/10 23:29:16 tgl Exp $
*
* NOTES
*
@@ -450,8 +450,9 @@ PostmasterMain(int argc, char *argv[])
/*
* Other options to pass to the backend on the command line
*/
- strcat(ExtraOptions, " ");
- strcat(ExtraOptions, optarg);
+ snprintf(ExtraOptions + strlen(ExtraOptions),
+ sizeof(ExtraOptions) - strlen(ExtraOptions),
+ " %s", optarg);
break;
case 'p':
SetConfigOption("port", optarg, PGC_POSTMASTER, PGC_S_ARGV);