Subject: Re: ed segfault
To: Jachym Holecek <firstname.lastname@example.org>
From: David Laight <email@example.com>
Date: 06/09/2006 22:04:35
On Fri, Jun 09, 2006 at 09:56:25PM +0200, Jachym Holecek wrote:
> # firstname.lastname@example.org 2006-06-09:
> > ed sefaults with a large string due to strcpy() below is a possible fix.
> FWIW the below should be s/MAXPATHLEN - 1/MAXPATHLEN + 1/g, since
> old_filename is defined as "char old_filename[MAXPATHLEN + 1]" and
> strlcpy() should include the terminating NUL in size.
Using 'sizeof (old_filename)' is likely to be better.
OTOH just truncating the string brings in it's own bugs....
David Laight: email@example.com