Re: Possible replace of strncpy on xactdesc.c - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Possible replace of strncpy on xactdesc.c
Date
Msg-id DCF74612-4E98-4B14-AE58-1FDFEF35E3F4@yesql.se
Whole thread
In response to Re: Possible replace of strncpy on xactdesc.c  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
> On 9 Jul 2026, at 08:15, Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote:

> Wouldn't memcpy(parsed->twophase_gid, bufptr, xlrec->gidlen) express the
> intent more directly?

memcpy would relax the check for twophase_gid being a char array, which albeit
being a small protection still seems like an API characteristic worth keeping.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Fix data checksum processing for temp relations and dropped databases
Next
From: Siddharth Kothari
Date:
Subject: Re: [PATCH] Add RetrieveInstrumentation hook for CustomScan providers