[syslog-ng] [PATCH] logproto: Fix log_proto_file_writer_flush()'s partial construction.

Gergely Nagy algernon at balabit.hu
Sat Oct 29 11:15:43 CEST 2011


Szalay Attila <sasa at balabit.hu> writes:

>> diff --git a/lib/logproto.c b/lib/logproto.c
>> index bdf9695..5047c98 100644
>> --- a/lib/logproto.c
>> +++ b/lib/logproto.c
>> @@ -299,7 +299,7 @@ log_proto_file_writer_flush(LogProto *s)
>>        /* allocate and copy the remaning data */
>>        self->partial = (guchar *)g_malloc(self->partial_len);
>>        ofs = sum - rc; /* the length of the remaning (not processed) chunk in the first message */
>> -        memcpy(self->partial, self->buffer[i0].iov_base + rc - (i0 > 0 ? (sum - self->buffer[i0 - 1].iov_len) : 0), ofs);
>> +      memcpy(self->partial, self->buffer[i0].iov_len - ofs, ofs);
>>        i = i0 + 1;
>>        while (i < self->buf_count)
>>          {
>
> I think this patch has some problem too.

ACK. I really should not code half-asleep. Thanks for catching the
mistake!

-- 
|8]



More information about the syslog-ng mailing list