Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)

Ranier Vilela <ranier.vf@gmail.com>

From: Ranier Vilela <ranier.vf@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Daniel Gustafsson <daniel@yesql.se>, Yugo NAGATA <nagata@sraoss.co.jp>, Richard Guo <guofenglinux@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-07-01T19:47:43Z
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 →
  1. Use safe string copy routine

Em seg., 1 de jul. de 2024 às 16:15, Alvaro Herrera <alvherre@alvh.no-ip.org>
escreveu:

> On 2024-Jul-01, Ranier Vilela wrote:
>
> > > -       char            name[MAXPGPATH + 1];
> > > +       char            name[MAXPGPATH];/* backup label name */
> > >
> > > With the introduced use of strlcpy, why do we need to change this
> field?
> > >
> > The part about being the only reference in the entire code that uses
> > MAXPGPATH + 1.
>
> The bit I don't understand about this discussion is what will happen
> with users that currently have exactly 1024 chars in backup names today.
> With this change, we'll be truncating their names to 1023 chars instead.
> Why would they feel that such change is welcome?
>
Yes of course, I understand.
This can be a problem for users.

best regards,
Ranier Vilela