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

Commit8f0fd47

Browse files
Use snprintf instead of sprintf in pg_regress.
To avoid static analyzers sounding the alarm, move to using snprintfinstead of sprintf. This was an oversight in66d6086.Reported-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/849588.1698179694@sss.pgh.pa.us
1 parent673a17e commit8f0fd47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ initialize_environment(void)
845845
{
846846
chars[16];
847847

848-
sprintf(s,"%d",port);
848+
snprintf(s,sizeof(s),"%d",port);
849849
setenv("PGPORT",s,1);
850850
}
851851
}
@@ -867,7 +867,7 @@ initialize_environment(void)
867867
{
868868
chars[16];
869869

870-
sprintf(s,"%d",port);
870+
snprintf(s,sizeof(s),"%d",port);
871871
setenv("PGPORT",s,1);
872872
}
873873
if (user!=NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp