cvs commit: src/lib/libipsec pfkey_dump.c

Jacques A. Vidrine nectar at FreeBSD.org
Wed Apr 16 05:47:00 PDT 2003


On Wed, Apr 16, 2003 at 04:21:13AM -0700, Munechika SUMIKAWA wrote:
> sumikawa    2003/04/16 04:21:13 PDT
> 
>   FreeBSD src repository
> 
>   Modified files:
>     lib/libipsec         pfkey_dump.c 
>   Log:
>   Make character buffer more bigger.
>   
>   Obtained from:  KAME
>   MFC after:      1 week

Hmm.

- char prefbuf[10];
+ char prefbuf[20];
  .
  .
  .
  snprintf(prefbuf, sizeof(prefbuf), "/%u", pref);

These sizes seem arbitrary.  Previously, at 10 bytes, they were just a
bit too small to hold the representation of the largest 32-bit
unsigned integer.  Now at 20 bytes, they are just a bit too small to
hold the representation of the largest 64-bit unsigned integer.  This
seems sloppy.  (As does using a 128 byte buffer to hold the result of
concatenating two 20 byte buffers.)

No big deal, I was just looking to make sure there were no other
implications and it struck me as odd.

Cheers,
-- 
Jacques A. Vidrine <nectar at celabo.org>          http://www.celabo.org/
NTT/Verio SME          .     FreeBSD UNIX     .       Heimdal Kerberos
jvidrine at verio.net     .  nectar at FreeBSD.org  .          nectar at kth.se


More information about the cvs-src mailing list