pgsql: Fix some dubious WAL-parsing code. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix some dubious WAL-parsing code.
Date
Msg-id E1f33XP-0007L2-Gm@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix some dubious WAL-parsing code.

Coverity complained about possible buffer overrun in two places added by
commit 1eb6d6527, and AFAICS it's reasonable to worry: even granting that
the WAL originator properly truncated the commit GID to GIDSIZE, we should
not really bet our lives on that having the same value as it does in the
current build.  Hence, use strlcpy() not strcpy(), and adjust the pointer
advancement logic to be sure we skip over the whole source string even if
strlcpy() truncated it.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b01f32c313f00846b6f06cf871d0d9ce7c3ad5e5

Modified Files
--------------
src/backend/access/rmgrdesc/xactdesc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: psql: Fix \ef, \sf tab completion
Next
From: Tom Lane
Date:
Subject: Re: pgsql: postgres_fdw: Push down partition-wise aggregation.