Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Apr 2003 07:46:57 -0500
From:      "Jacques A. Vidrine" <nectar@FreeBSD.org>
To:        Munechika SUMIKAWA <sumikawa@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libipsec pfkey_dump.c
Message-ID:  <20030416124657.GD72501@madman.celabo.org>
In-Reply-To: <200304161121.h3GBLDhJ040405@repoman.freebsd.org>
References:  <200304161121.h3GBLDhJ040405@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@celabo.org>          http://www.celabo.org/
NTT/Verio SME          .     FreeBSD UNIX     .       Heimdal Kerberos
jvidrine@verio.net     .  nectar@FreeBSD.org  .          nectar@kth.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030416124657.GD72501>