[syslog-ng] [PATCH 1/7] [persist]: only check the buffer size if no encoding is specified

Gergely Nagy algernon at balabit.hu
Sat May 28 14:30:00 CEST 2011


Balazs Scheidler <bazsi at balabit.hu> writes:

> Hi,
>
> Can you please explain when this causes problems and what the problem
> is? Does it perhaps need to be backported to earlier versions?

As far as I remember, this caused problems when encoding() was
specified for a source (a file source, in this case). In particular, a
source file with UCS4 encoding triggered a crash.

As I understand it, if encoding is in place, then the size of
self->buffer does not matter all that much, since we'll be using a
different buffer. However, due to encoding issues, the raw buffer size
might easily be larger than what we have allocated for self->buffer -
but that's no big deal in this case, because we'll allocate a large
enough buffer in the else branch.

(Note: this is my understanding of the code, this area is a bit hazy for
me at the moment)

-- 
|8]


More information about the syslog-ng mailing list