[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dev-serveez] Small patch (bugfixes)
From: |
Andreas Rottmann |
Subject: |
[dev-serveez] Small patch (bugfixes) |
Date: |
19 Dec 2002 16:16:55 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Hi!
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.
serveez-fixes.patch
Description: Text Data
Regards, Andy
--
Andreas Rottmann | address@hidden | address@hidden |
address@hidden
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62
- [dev-serveez] Small patch (bugfixes),
Andreas Rottmann <=