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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
Date: 2024-06-24 00:23:50
Message-ID: Zni8lmBGRe_-kcu3@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2024-06-24 00:31:51 Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
Previous Message Tatsuo Ishii 2024-06-24 00:23:37 Re: Unable parse a comment in gram.y