On Sat, 2011-05-28 at 14:30 +0200, Gergely Nagy wrote:
Balazs Scheidler <bazsi@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)
I don't see how this fixes the crash, but I'll see to it if I can reproduce the original problem. -- Bazsi