Christopher Browne cbbrowne at ca.afilias.info
Thu Feb 11 12:49:25 PST 2010
Gwyn Connor <gwyn.connor at googlemail.com> writes:
> the slon_log function in 2.0.3-rc3 contains a very bad sprintf bug,
> where source and target buffer are the same. In such a case the
> standard says that the result of sprintf is undefined (according to
> the sprintf man page). And this causes slon to not log timestamps on
> my Gentoo machine.

One bit of "language lawyering"...

I'd like to validate the "undefinedness" a bit...

 - I took a peek at Harbison & Steele, and it doesn't indicate that such
   a result is expected to be undefined according to C standard

 - I looked at my sprintf() man page, and the most nearly relevant bit
   reads thus:

      If copying takes place between objects that overlap as a result of
      a call to sprintf() or snprintf(), the results are undefined.

It's conceivable that there's a Gentoo problem here, too.  I don't mean
to be disagreeable, but it's conceivable that Gentoo's claiming
something about the standard that mightn't hold true.

I'll note that the problem dates back to 2004, and it does look like a
fine thing to change, so I'll be backpatching this everywhere.
-- 
select 'cbbrowne' || '@' || 'ca.afilias.info';
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-general mailing list