Re: Possible replace of strncpy on xactdesc.c

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: Mario González Troncoso <gonzalemario(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible replace of strncpy on xactdesc.c
Date: 2026-07-09 08:00:54
Message-ID: DCF74612-4E98-4B14-AE58-1FDFEF35E3F4@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 9 Jul 2026, at 08:15, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Siddharth Kothari 2026-07-09 08:07:03 Re: [PATCH] Add RetrieveInstrumentation hook for CustomScan providers
Previous Message Daniel Gustafsson 2026-07-09 07:56:44 Re: Fix data checksum processing for temp relations and dropped databases