Use safe string copy routine
authorDaniel Gustafsson <[email protected]>
Tue, 2 Jul 2024 09:16:56 +0000 (11:16 +0200)
committerDaniel Gustafsson <[email protected]>
Tue, 2 Jul 2024 09:16:56 +0000 (11:16 +0200)
commite930c872b65c19c8950556fa94aa9ab53b2919b0
tree5dd981f75405cbce88323a61ba3a438a640ad1c0
parentda3ea048ca568f570cb579c090cf1a84554b8bec
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 <[email protected]>
Discussion: https://postgr.es/m/CAEudQApAsbLsQ+gGiw-hT+JwGhgogFa_=5NUkgFO6kOPxyNidQ@mail.gmail.com
src/backend/access/transam/xlog.c