> On 27 Jun 2024, at 13:50, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
> Now with file patch really attached.
- if (strlen(backupidstr) > MAXPGPATH)
+ if (strlcpy(state->name, backupidstr, sizeof(state->name)) >= sizeof(state->name))
ereport(ERROR,
Stylistic nit perhaps, I would keep the strlen check here and just replace the
memcpy with strlcpy. Using strlen in the error message check makes the code
more readable.
- char name[MAXPGPATH + 1];
+ char name[MAXPGPATH];/* backup label name */
With the introduced use of strlcpy, why do we need to change this field?
--
Daniel Gustafsson