[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dev-serveez] Small patch (bugfixes)
From: |
stefan |
Subject: |
Re: [dev-serveez] Small patch (bugfixes) |
Date: |
Sun, 22 Dec 2002 11:49:57 +0100 (CET) |
On 19 Dec 2002, Andreas Rottmann wrote:
> Hi!
Hello!
> I discovered two bugs in serveez:
>
> 1) in coserver.c, coserver->sock was not initialized (thanks to
> valgrind for pointing this out ;-))
>
> 2) svz_sock_reduce_{send,recv}: These macros did not bracket the
> arguments wich leads to unexpected results. example: if you passed
> 'a + b' for len, this would have been expanded to:
>
> if (a + b && sock->recv_buffer_fill > a + b)
> memmove (sock->recv_buffer, sock->recv_buffer + a + b,
> sock->recv_buffer_fill - a + b); // <- note this line
>
> instead of (what is expanded now):
>
> if ((a + b) && (sock)->recv_buffer_fill > (a + b))
> memmove ((sock)->recv_buffer, (sock)->recv_buffer + (a + b),
> (sock)->recv_buffer_fill - (a + b)); // <- note this line
>
> Maybe you should check all other macros too. This bug took me quite
> some time to dicover, since I didn't expect the macros to be *so*
> wrong (they are used quite a lot in serveez, so it's strange this
> hadn't come up).
>
> The attached patch (against CVS) fixes the above bugs and also notes
> the changes in the ChangeLog.
Thank you very much for the report. I'll apply the bugfix ASAP (This
will happen next year..). I do have some pending changes here myself and
also will supply some mutex functionality as discussed in previous mails.
I'll also re-consider the dont-kick-socket-on-receive-buffer-overflow.
This will possibly go into a socket flag.
Before doing so we yet need to wait for the 'history' file issue in CVS
being solved...
Cheers,
address@hidden