Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
Date
Msg-id Zni8lmBGRe_-kcu3@paquier.xyz
Whole thread Raw
In response to Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
List pgsql-hackers
On Sun, Jun 23, 2024 at 09:08:47PM -0300, Fabrízio de Royes Mello wrote:
> Doesn’t “sizeof” solve the problem? It take in account the null-termination
> character.

The size of BackupState->name is fixed with MAXPGPATH + 1, so it would
be a better practice to use strlcpy() with sizeof(name) anyway?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Unable parse a comment in gram.y
Next
From: Ranier Vilela
Date:
Subject: Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)