public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Fabrízio de Royes Mello <[email protected]>
Cc: Ranier Vilela <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
Date: Mon, 24 Jun 2024 09:23:50 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFcNs+p2NSyT0Vs2gFxGwFn02jEj_DgHWK0N-F18EtENh-8TEw@mail.gmail.com>
References: <CAEudQApAsbLsQ+gGiw-hT+JwGhgogFa_=5NUkgFO6kOPxyNidQ@mail.gmail.com>
	<CAFcNs+p2NSyT0Vs2gFxGwFn02jEj_DgHWK0N-F18EtENh-8TEw@mail.gmail.com>

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


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox