Commit 9e26326a authored by Alvaro Herrera's avatar Alvaro Herrera

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.
parent c1494b73
......@@ -425,7 +425,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
{
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);
got_nextxlogfile = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment