pgsql: Use safe string copy routine - Mailing list pgsql-committers

From Daniel Gustafsson
Subject pgsql: Use safe string copy routine
Date
Msg-id E1sOZlu-00017D-FL@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Use safe string copy routine

Using memcpy with strlen as the size parameter will not take the
NULL terminator into account, relying instead on the destination
buffer being properly initialized. Replace with strlcpy which is
a safer alternative, and more in line with how we handle copying
strings elsewhere.

Author: Ranier Vilela <ranier.vf@gmail.com>
Discussion: https://postgr.es/m/CAEudQApAsbLsQ+gGiw-hT+JwGhgogFa_=5NUkgFO6kOPxyNidQ@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/xlog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Remove too demanding test
Next
From: Nathan Bossart
Date:
Subject: pgsql: pg_dump: Remove some unused return values.