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

From Mario González Troncoso
Subject Re: Possible replace of strncpy on xactdesc.c
Date
Msg-id CAFsReFWd5dmy16S5Umsn=peurgpiph0fd4H1BmLtbrMzC_OvPA@mail.gmail.com
Whole thread
In response to Re: Possible replace of strncpy on xactdesc.c  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Possible replace of strncpy on xactdesc.c
List pgsql-hackers
On Mon, 6 Jul 2026 at 10:38, Daniel Gustafsson <daniel@yesql.se> wrote:
>
>
> As a general rule it's a good idea to replace strncpy with strlcpy.
>
> > The other functions that are inside the file already use strlcpy() so
> > maybe the use of current strncpy() on xactdesc.c is just code that
> > comes from the refactor itself.
>
> It was introduced in 1eb6d6527aae in twophase.c and then moved to xaxtdesc.c in
> the above mentioned commit.
>
> > I'll send a proper patch once some feedback is received but at least
> > it's compiling and passing local tests.
>
> Sounds good, please send a patch.
>

Great. Sending it now after rebasing from master and passing local
tests (long live cirrus CI).

I added this to the commitfest as well
https://commitfest.postgresql.org/patch/6989/

>


-- 
Mario Gonzalez
EDB: https://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks