pgsql: Use pg_parse_lsn() for IDENTIFY_SYSTEM responses in libpqwalrece
pgsql: Use pg_parse_lsn() for IDENTIFY_SYSTEM responses in libpqwalrece
От:
Fujii Masao <fujii@postgresql.org>
Дата:
Use pg_parse_lsn() for IDENTIFY_SYSTEM responses in libpqwalreceiver
libpqwalreceiver parses the WAL flush location returned by
IDENTIFY_SYSTEM using sscanf("%X/%X") into uint32 values. This
accepts overlong components and trailing characters, potentially
producing a different LSN from the one supplied by the upstream server.
Use pg_parse_lsn() instead, requiring one to eight hexadecimal digits
per component and no trailing characters, as for pg_lsn input. Reject
malformed locations with the existing protocol violation error.
Suggested-by: Ayush Tiwari
Author: Hayato Kuroda
Reviewed-by: Jan Nidzwetzki
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/tencent_C6ED19DF1759CDD37E786F7EE0B5207D0009@qq.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ba6d9ee259cdb2a6c862a4741b16194106e00a9a
Modified Files
--------------
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)