mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Sync OpenBSD patchset 462:
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.
This commit is contained in:
parent
5a4ba76293
commit
876ded6dfe
@ -1,4 +1,4 @@
|
||||
/* $Id: server-client.c,v 1.7 2009-10-28 22:50:24 tcunha Exp $ */
|
||||
/* $Id: server-client.c,v 1.8 2009-10-28 23:06:41 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -152,6 +152,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;
|
||||
|
Loading…
Reference in New Issue
Block a user