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

Commit5dfd506

Browse files
committed
Defend against overrun of ExtraOptions array --- strictly paranoia,
since the person or script starting the postmaster has to be trustedanyway.
1 parent99b225c commit5dfd506

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.405 2004/06/24 21:02:55 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.406 2004/07/10 23:29:16 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -450,8 +450,9 @@ PostmasterMain(int argc, char *argv[])
450450
/*
451451
* Other options to pass to the backend on the command line
452452
*/
453-
strcat(ExtraOptions," ");
454-
strcat(ExtraOptions,optarg);
453+
snprintf(ExtraOptions+strlen(ExtraOptions),
454+
sizeof(ExtraOptions)-strlen(ExtraOptions),
455+
" %s",optarg);
455456
break;
456457
case'p':
457458
SetConfigOption("port",optarg,PGC_POSTMASTER,PGC_S_ARGV);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp