Re: strncpy is not a safe version of strcpy - Mailing list pgsql-hackers

From Andres Freund
Subject Re: strncpy is not a safe version of strcpy
Date
Msg-id 20131115150146.GB5489@awork2.anarazel.de
Whole thread Raw
In response to Re: strncpy is not a safe version of strcpy  (Stephen Frost <sfrost@snowman.net>)
Responses Re: strncpy is not a safe version of strcpy  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2013-11-15 10:04:12 -0500, Stephen Frost wrote:
> * Andres Freund (andres@2ndquadrant.com) wrote:
> > Sure, there can be longer paths, but postgres don't support them. In a
> > *myriad* of places. It's just not worth spending code on it.
> >
> > Just about any of the places that use MAXPGPATH are "vulnerable" or
> > produce confusing error messages if it's exceeded. And there are about
> > zero complaints about it.
> 
> Confusing error messages are one thing, segfaulting is another.

I didn't argue against s/strncpy/strlcpy/. That's clearly a sensible
fix.
I am arguing about introducing additional code and error messages about
it, that need to be translated. And starting doing so in isolationtester
of all places.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: strncpy is not a safe version of strcpy
Next
From: Michael Paquier
Date:
Subject: Re: Turning recovery.conf into GUCs