Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Ranier Vilela <ranier.vf@gmail.com>
Cc: Fabrízio de Royes Mello <fabriziomello@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2024-06-24T00:53:52Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Use safe string copy routine
- e930c872b65c 18.0 landed
On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote: > It's not critical code, so I think it's ok to use strlen, even because the > result of strlen will already be available using modern compilers. > > So, I think it's ok to use memcpy with strlen + 1. It seems to me that there is a pretty good argument to just use strlcpy() for the same reason as the one you cite: this is not a performance-critical code, and that's just safer. -- Michael