Eggdev: putlog patch

Darko Ilic darko at onvol.net
Tue Mar 16 13:01:14 CST 2004


HI Dariuzs,

Indeed there is a patch that resolves the bug (sorry i haven't noticed 
it earlier) but it does so only partly. There is still the issue of  
uninitialsed char stamp[34] being passed to fprintf later in the 
putlog() function which will result in garbage being printed and often 
in segmentation fault. (as per my original mail)

Darko

Dariusz Kulinski wrote:

>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.
>
>  
>




More information about the Eggdev mailing list