Re: strncpy is not a safe version of strcpy

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: strncpy is not a safe version of strcpy
Дата
Msg-id 20131115150146.GB5489@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: strncpy is not a safe version of strcpy  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: strncpy is not a safe version of strcpy  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: strncpy is not a safe version of strcpy
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Turning recovery.conf into GUCs