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.
This commit is contained in:
Daniel Eklöf 2019-11-05 09:31:47 +01:00
parent 5f77f0e999
commit 5b3fe4492c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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;