[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: off-by-one error in realpath(3)
- To: tech@openbsd.org
- Subject: Re: off-by-one error in realpath(3)
- From: William Ahern <william@25thandClement.com>
- Date: Mon, 4 Aug 2003 10:16:15 -0700
- Content-Disposition: inline
- References: <200308041641.h74GfMco010994@xerxes.courtesan.com>
- User-Agent: Mutt/1.5.4i
On Mon, Aug 04, 2003 at 10:41:22AM -0600, Todd C. Miller wrote:
> An off-by-one error exists in the C library function realpath(3).
> This is the same bug that was recently found in the wu-ftpd ftpd
> server by Janusz Niewiadomski and Janusz Niewiadomski.
>
Why isn't snprintf() used more often? It seems to me that it is less
error prone to use snprintf() then to do your copying and length
calculations separately.
- Bill