From 59687e04e08d5d9df4a63287bc2ff2ff7afded43 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 15 Sep 2017 11:27:03 +0800 Subject: [PATCH] lws_protocol_vh_priv_get: fail gracefully with NULL vhost --- lib/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/context.c b/lib/context.c index a2ef9609..f7bf5a00 100644 --- a/lib/context.c +++ b/lib/context.c @@ -86,7 +86,7 @@ lws_protocol_vh_priv_get(struct lws_vhost *vhost, const struct lws_protocols *pr { int n = 0; - if (!vhost->protocol_vh_privs) + if (!vhost || !vhost->protocol_vh_privs) return NULL; while (n < vhost->count_protocols && &vhost->protocols[n] != prot)