From 5b3fe4492c78124949bcba8c215e65388c116602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 5 Nov 2019 09:31:47 +0100 Subject: [PATCH] server: workaround evil clients If the clients attempt to send more data after we've instantiated the terminal, just consume the data but ignore it. --- server.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.c b/server.c index 8dc9018e..498ea2f3 100644 --- a/server.c +++ b/server.c @@ -102,6 +102,12 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data) assert(events & EPOLLIN); + if (client->term != NULL) { + uint8_t dummy[128]; + read(fd, dummy, sizeof(dummy)); + return true; + } + uint16_t term_env_len; if (recv(fd, &term_env_len, sizeof(term_env_len), 0) != sizeof(term_env_len)) goto shutdown;