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

From Daniel Gustafsson
Subject Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
Date
Msg-id 9AFD6238-FD60-4794-A2F4-0557450BEDD2@yesql.se
Whole thread Raw
In response to Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
List pgsql-hackers
> On 2 Jul 2024, at 02:33, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Mon, Jul 01, 2024 at 09:19:59PM +0200, Daniel Gustafsson wrote:
>>> 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?
>>
>> That's precisely what I was getting at.  Maybe it makes sense to change, maybe
>> not, but that's not for this patch to decide as that's a different discussion
>> from using safe string copying API's.
>
> Yep.  Agreed to keep backward-compatibility here, even if I suspect
> there is close to nobody relying on backup label names of this size.

I suspect so too, and it might be a good project for someone to go over such
buffers to see if there is reason grow or contract.  Either way, pushed the
strlcpy part.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Optimize numeric.c mul_var() using the Karatsuba algorithm
Next
From: Amit Kapila
Date:
Subject: Re: pg_createsubscriber: drop pre-existing subscriptions from the converted node