Author: Gte <gte@atomicrevs.demon.co.uk>
authorBleep <twhelvey1@home.com>
Tue, 14 Mar 2000 01:35:20 +0000 (01:35 +0000)
committerBleep <twhelvey1@home.com>
Tue, 14 Mar 2000 01:35:20 +0000 (01:35 +0000)
commit4af8b1159c020faa1a1d2f273728f670630a21c6
tree35ce5f500d50a03cfccdf9435af5a8ac9ee49d43
parenta62e116593c09024bfb1f9d815df4b88db0f4bfe
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
.patches
ChangeLog
ircd/s_auth.c