Re: (yet) more buffer paranoia

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: (yet) more buffer paranoia
Дата
Msg-id 200208281906.g7SJ6lg04163@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: (yet) more buffer paranoia  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-patches
Peter Eisentraut wrote:
> Neil Conway writes:
>
> > This patches replaces a few more usages of strcpy() and sprintf() when
> > copying into a fixed-size buffer (in this case, a buffer of
> > NAMEDATALEN bytes). AFAICT nothing to worry about here, but worth
> > fixing anyway...
>
> Changing strcpy to strncpy is incorrect.  strncpy should be banned.

Good point.  Maybe StrNCpy, which is our standard strncpy().

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Proposed GUC Variable
Следующее
От: Larry Rosenman
Дата:
Сообщение: Re: [HACKERS] Proposed GUC Variable