commit 7235e65f98c5fd8d937dca87ae1b1794ec3eee96
parent 445c17837fb06fd2f173957fbac7b396f52f8ac4
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 17 Oct 2016 21:02:16 +0300
MHD_cleanup_upgraded_connection_(): check pointer for NULL *before* dereferencing
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -923,7 +923,8 @@ MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection)
struct MHD_UpgradeResponseHandle *urh = connection->urh;
#if HTTPS_SUPPORT
- if (0 != (daemon->options & MHD_USE_TLS))
+ if ( (NULL != urh) &&
+ (0 != (daemon->options & MHD_USE_TLS)) )
{
if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
DLL_remove (daemon->urh_head,