Author: Gte <gte@atomicrevs.demon.co.uk>
Log message:
Bugfix: uninitialized variable causing getsockname to fail and trigger
other bugs.
In s_auth.c:103, insert:
len = sizeof(sock);
just before:
if (getsockname(cptr->fd, (struct sockaddr *)&sock, &len) == -1
|| (sock.sin_port = 0) /* Reset sin_port and let OS choose
|| bind(cptr->authfd, (struct sockaddr *)&sock, len) == -1)
This initialises len correctly, and everything then works :)
--
On a sidenote, I noticed the result of this failure is that the clients
socket is closed, surely closing the authfd would be better than just
cutting off the client? :P
The authfd then never gets closed, and also the ircd hits 100% cpu,
presumably because this client is still in a list somewhere, but with a
closed Fd, maybe, not looked :)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@22
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c