From 43f9a8de80248832bbbdbe59f9714cd6f858ffac Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 4 Apr 2018 10:37:00 +0800 Subject: [PATCH] Coverity 189185: access_log: guarantee no null wsi vhost --- lib/server/access-log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/server/access-log.c b/lib/server/access-log.c index 5c0e7c2c..a4e30fe1 100644 --- a/lib/server/access-log.c +++ b/lib/server/access-log.c @@ -51,8 +51,11 @@ lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth) time_t t = time(NULL); int l = 256, m; + if (!wsi->vhost) + return; + /* only worry about preparing it if we store it */ - if (wsi->vhost && wsi->vhost->log_fd == (int)LWS_INVALID_FILE) + if (wsi->vhost->log_fd == (int)LWS_INVALID_FILE) return; if (wsi->access_log_pending)