Eggdev: putlog patch

Dariusz Kulinski takeda at eggheads.w.pl
Mon Mar 15 18:58:59 CST 2004


Hello Darko,

Saturday, March 13, 2004, 11:52:10 AM, you wrote:

> Hello,

> There is a bug in misc.c within the putlog function that managed to stay
> hidden for so long because it only shows in the unlikely event of 
> someone not logging the timestamps. However, if timestamps are off 
> (log-time is zero) the  charachter array holding the timestamp (char
> stamp[34]) will be uninitialized, making subsequent call to fprintf 
> produce garbage and even crash (in the part that deals with the `last
> line repeats X times' part of function).

> Moreover, pointer to time structure t (struct tm *t) will point to a
> space possibly (and usually) containing garbage and if keep-all-logs is
> set to 1, ultimatly lead to segment violation in the call to egg_strftime()

> Reproducing is trivial:

> set log-time 0
> set keep-all-logs 1

> Patch is trivial as well - take initialisation of pointer t out of the
> if clause (so to always be initialised) and set the first element of
> stamp to NUL char.

> Patch against 1.6.15 has been sent to patches at eggheads.org

That bug (introduced by me anyway ;) was fixed right after 1.6.15 was
released, and is already fixed in cvs eggdrop version.

-- 
Best regards,
 Dariusz                            mailto:takeda at eggheads.w.pl
http://eggdrop.takeda.tk - eggdrop help





More information about the Eggdev mailing list