mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
Fix off-by-one in passing buffer size to xsnprintf
This would cause a consistent panic (exit() call) without reason. This should not enable any overruns (but check my work). Signed-off-by: Dan Farina <drfarina@acm.org>
This commit is contained in:
2
repmgr.c
2
repmgr.c
@@ -883,7 +883,7 @@ do_standby_clone(void)
|
||||
size_t buf_sz = strlen(first_wal_seg_pq);
|
||||
|
||||
first_wal_segment = malloc(buf_sz + 1);
|
||||
xsnprintf(first_wal_segment, buf_sz, "%s", first_wal_seg_pq);
|
||||
xsnprintf(first_wal_segment, buf_sz + 1, "%s", first_wal_seg_pq);
|
||||
}
|
||||
|
||||
first_wal_segment = PQgetvalue(res, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user