mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-22 21:31:16 +01:00
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
53957dcbaa
commit
353f2a2ad4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user