mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
pg_upgrade: fix off-by-one mistake in snprintf
snprintf counts trailing NUL towards the char limit. Failing to account for that was causing an invalid value to be passed to pg_resetxlog -l, aborting the upgrade process.
This commit is contained in:
@ -425,7 +425,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
|
|||||||
{
|
{
|
||||||
if (got_log_id && got_log_seg)
|
if (got_log_id && got_log_seg)
|
||||||
{
|
{
|
||||||
snprintf(cluster->controldata.nextxlogfile, 24, "%08X%08X%08X",
|
snprintf(cluster->controldata.nextxlogfile, 25, "%08X%08X%08X",
|
||||||
tli, logid, segno);
|
tli, logid, segno);
|
||||||
got_nextxlogfile = true;
|
got_nextxlogfile = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user