From e17820cf67572496715e3e85baa1c298faff26bb Mon Sep 17 00:00:00 2001 From: Frank May Date: Sun, 19 Aug 2018 06:43:14 +0800 Subject: [PATCH] windows: fix possible crash Checking for (!wsi) does not make sense, if wsi is dereferenced in the line above. --- lib/plat/windows/windows-service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plat/windows/windows-service.c b/lib/plat/windows/windows-service.c index b027adddd..0fb67855c 100644 --- a/lib/plat/windows/windows-service.c +++ b/lib/plat/windows/windows-service.c @@ -82,9 +82,9 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) continue; wsi = wsi_from_fd(context, pfd->fd); - if (wsi->listener) + if (!wsi || wsi->listener) continue; - if (!wsi || wsi->sock_send_blocking) + if (wsi->sock_send_blocking) continue; pfd->revents = LWS_POLLOUT; n = lws_service_fd(context, pfd);