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

Commit9e26326

Browse files
committed
pg_upgrade: fix off-by-one mistake in snprintf
snprintf counts trailing NUL towards the char limit. Failing to accountfor that was causing an invalid value to be passed to pg_resetxlog -l,aborting the upgrade process.
1 parentc1494b7 commit9e26326

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎contrib/pg_upgrade/controldata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
425425
{
426426
if (got_log_id&&got_log_seg)
427427
{
428-
snprintf(cluster->controldata.nextxlogfile,24,"%08X%08X%08X",
428+
snprintf(cluster->controldata.nextxlogfile,25,"%08X%08X%08X",
429429
tli,logid,segno);
430430
got_nextxlogfile= true;
431431
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp