[syslog-ng] value-pairs and sdata

Gergely Nagy algernon at balabit.hu
Sun May 22 13:28:02 CEST 2011


Balazs Scheidler <bazsi at balabit.hu> writes:

> Ok, agreed, I'll then remove my patches from libmongo-client and change
> the assumption in syslog-ng on how libmongo-client works, and then
> release 3.3beta1.

Thanks, and sorry for being a bit indecisive earlier O:)

By the way, before you release beta1: I've sent a patch earlier, which
fixed mongodb's value-pairs() support. One which you supposedly applied,
but I couldn't find it in your git tree.

It was something like this:

commit 39aa0f7ae0dbf099034c8384291c91688b262bfa
Author: Gergely Nagy <algernon at balabit.hu>
Date:   Sun May 8 10:19:19 2011 +0200

    afmongodb: Fix a possible crash during configuration.

    During configuration, if the user specified value-pairs(), the driver
    would crash, because it tried to free a NULL structure.

    Signed-off-by: Gergely Nagy <algernon at balabit.hu>

diff --git a/modules/afmongodb/afmongodb.c b/modules/afmongodb/afmongodb.c
index 68594d7..422058e 100644
--- a/modules/afmongodb/afmongodb.c
+++ b/modules/afmongodb/afmongodb.c
@@ -148,7 +148,8 @@ afmongodb_dd_set_value_pairs(LogDriver *d, ValuePairs *vp)
 {
   MongoDBDestDriver *self = (MongoDBDestDriver *)d;

-  value_pairs_free (self->vp);
+  if (self->vp)
+    value_pairs_free (self->vp);
   self->vp = vp;
 }

Either this is needed, or value_pairs_free() needs to bail out early if
vp is NULL.

-- 
|8]


More information about the syslog-ng mailing list