Re: (yet) more buffer paranoia

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: (yet) more buffer paranoia
Date: 2002-08-28 19:06:47
Message-ID: 200208281906.g7SJ6lg04163@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Larry Rosenman 2002-08-28 19:07:57 Re: [HACKERS] Proposed GUC Variable
Previous Message Bruce Momjian 2002-08-28 19:05:05 Re: [HACKERS] Proposed GUC Variable