pgsql: Use pg_parse_lsn() for timeline history switchpoints
pgsql: Use pg_parse_lsn() for timeline history switchpoints
От:
Fujii Masao <fujii@postgresql.org>
Дата:
Use pg_parse_lsn() for timeline history switchpoints
readTimeLineHistory() previously parsed WAL switchpoints in timeline
history files using sscanf("%X/%08X") into uint32 values. An
overlong high component could overflow, while an overlong low component
was truncated to its first eight digits. Trailing characters were also
ignored.
Extract the switchpoint token and use pg_parse_lsn() to validate and
convert it, requiring one to eight hexadecimal digits per component
with no trailing characters, as for pg_lsn input. This matches the
change to pg_rewind's history file parser in commit f31d6fbc31d.
Author: Jan Nidzwetzki
Reviewed-by: Hayato Kuroda
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/8b1abbd0-7335-4e68-93ec-91cdbbfd9568@planetscale.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5ffb8c7409385c58e5c1abaa22ee77ba4c1b5c33
Modified Files
--------------
src/backend/access/transam/timeline.c | 37 +++++++++++++++++++++++++++--------
1 file changed, 29 insertions(+), 8 deletions(-)