From bc3b319783254e95cfa9a6ee0ef605837690e860 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Thu, 20 Dec 2018 02:20:41 +0100 Subject: [PATCH] Fix potential crash if context is null on closed socket If the other side closes the connection this might happen Without this check the following m_context.readBuffer would segfault --- source/vibe/core/net.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/core/net.d b/source/vibe/core/net.d index 4cb08e7..c183d1d 100644 --- a/source/vibe/core/net.d +++ b/source/vibe/core/net.d @@ -580,7 +580,7 @@ mixin(tracer); asyncAwaitAny!(true, waiter)(timeout); - if (cancelled) return false; + if (cancelled || !m_context) return false; logTrace("Socket %s, read %s bytes: %s", m_socket, nbytes, status);