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

Peter Nahas pnahas at mrv.com
Wed Oct 26 16:57:49 CEST 2005


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;



More information about the syslog-ng mailing list