From ba7e76f2cee6e1ee6c7eb1709370a1fbddea50a1 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 22 Dec 2019 16:56:22 -0500 Subject: Exit on zero-length server read --- server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/server.c b/server.c index 80d34df..ce5ae87 100644 --- a/server.c +++ b/server.c @@ -130,6 +130,7 @@ void serverRecv(void) { ssize_t read = tls_read(client, &buf[len], sizeof(buf) - len); if (read == TLS_WANT_POLLIN || read == TLS_WANT_POLLOUT) return; if (read < 0) errx(EX_IOERR, "server tls_read: %s", tls_error(client)); + if (!read) errx(EX_PROTOCOL, "server closed connection"); len += read; char *crlf; -- cgit 1.4.1