[syslog-ng] syslog-ng-1.9.6 template bug patch

Balazs Scheidler bazsi at balabit.hu
Thu Nov 3 18:03:57 CET 2005


On Wed, 2005-10-26 at 10:57 -0400, Peter Nahas wrote:
> I have stumbled upon a bug in syslog-ng-1.9.6 caused by an un-cleared 
> buffer in logwriter.c which causes templated messages to be output 
> improperly.  Up until a certain point (not certain why it stops, perhaps 
> due to a buffer size?), for each message output, all previous messages 
> are output.  For example, if the messages "One" "Two" and "Three" are 
> sent to syslog-ng, the destination will receive "One" "One" "Two" "One" 
> "Two" "Three".  I have included a patch which solves the issue, but 
> there may be a better solution.  If you want a syslog-ng.conf which will 
> produce this issue, let me know.
> 
> Thanks,
> 
> Peter Nahas
> Software Engineer
> MRV Communications - InReach Division
> 
> --- 1.9.6/logwriter.c   2005-10-26 09:59:09.000000000 -0400
> +++ mine/logwriter.c    2005-10-26 09:59:58.000000000 -0400
> @@ -160,7 +160,8 @@
>  {
>    LogTemplate *template = NULL;
> 
> -
> +  g_string_assign(result, "");
> +
>    if (self->options->template)
>      {
>        template = self->options->template;

I've just committed a somewhat different fix for the issue. Thanks for
reporting it. 

-- 
Bazsi



More information about the syslog-ng mailing list