summary refs log tree commit diff
path: root/server.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-22 16:56:22 -0500
committerJune McEnroe <june@causal.agency>2019-12-22 16:56:22 -0500
commitba7e76f2cee6e1ee6c7eb1709370a1fbddea50a1 (patch)
treea7e3db21076fd234af2ff37739a81d741631563c /server.c
parentRevert "Exit when server gets POLLHUP" (diff)
downloadpounce-ba7e76f2cee6e1ee6c7eb1709370a1fbddea50a1.tar.gz
pounce-ba7e76f2cee6e1ee6c7eb1709370a1fbddea50a1.zip
Exit on zero-length server read
Diffstat (limited to '')
-rw-r--r--server.c1
1 files changed, 1 insertions, 0 deletions
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;
le.c?h=1.7&id=83a8952cf5fa7e1e8147d322d80bdecbe0a1a217&follow=1'>Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe