From: Tom Lane Date: Sat, 10 Jul 2004 23:29:16 +0000 (+0000) Subject: Defend against overrun of ExtraOptions array --- strictly paranoia, X-Git-Tag: REL9_0_0~12434 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5dfd5063e242ccea2ba3fc70c19f5f84f9f8402c;p=pg-rex%2Fsyncrep.git Defend against overrun of ExtraOptions array --- strictly paranoia, since the person or script starting the postmaster has to be trusted anyway. --- diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 5d908807b9..ee934711ff 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);