Don't do anything in the client callback if the client has already died to

avoid a use-after-free (the callback is used twice, once for the client itself
and once for the tty). Fixes crashes seen by Han Boetes.
pull/1/head
Nicholas Marriott 2009-10-26 20:47:00 +00:00
parent 53957dcbaa
commit 353f2a2ad4
1 changed files with 3 additions and 0 deletions

View File

@ -153,6 +153,9 @@ server_client_callback(int fd, int events, void *data)
{
struct client *c = data;
if (c->flags & CLIENT_DEAD)
return;
if (fd == c->ibuf.fd) {
if (events & (POLLERR|POLLNVAL|POLLHUP))
goto client_lost;