Subject: Re: bin/34055: wierd output from date
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 07/23/2006 18:20:03
The following reply was made to PR bin/34055; it has been noted by GNATS.

From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/34055: wierd output from date
Date: Sun, 23 Jul 2006 19:31:13 +0100

 On Sat, Jul 22, 2006 at 09:10:00PM +0000, new.security@gmail.com wrote:
 >  
 > -       (void)strftime(buf, sizeof(buf), format, localtime(&tval));
 > +       (void)strftime(buf, sizeof(buf)-93, format, localtime(&tval));
 
 One might ask 'why 93' ...
 
 If 'buf' isn't long enough, strftime doesn't guarantee anything about
 its contents.
 I'd even suspect that it aborts when it can't fit (say) "september"
 into the available space - possibly without 0 terminating the buffer.
 
 	David
 
 -- 
 David Laight: david@l8s.co.uk