summary refs log tree commit diff
path: root/bounce.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-02 16:36:04 -0400
committerJune McEnroe <june@causal.agency>2020-04-02 16:37:36 -0400
commitd8d8b04e93be758d96d9cf8d8ffa3f063adf51fc (patch)
tree93d9808580d56467050916ec09a41be90cc23187 /bounce.c
parentDo not crash on error from accept in calico (diff)
downloadpounce-d8d8b04e93be758d96d9cf8d8ffa3f063adf51fc.tar.gz
pounce-d8d8b04e93be758d96d9cf8d8ffa3f063adf51fc.zip
Do not crash on error from accept
Diffstat (limited to '')
-rw-r--r--bounce.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bounce.c b/bounce.c
index 604830a..6c3e285 100644
--- a/bounce.c
+++ b/bounce.c
@@ -484,6 +484,11 @@ int main(int argc, char *argv[]) {
 			if (!event.clients[i]) {
 				int fd;
 				struct tls *tls = localAccept(&fd, event.fds[i].fd);
+				if (!tls) {
+					warn("accept");
+					continue;
+				}
+
 				int error = tls_handshake(tls);
 				if (error) {
 					warnx("tls_handshake: %s", tls_error(tls));