1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ss: reject direct protocol metadata if NULL ss wsi

The ss wsi may be NULL after any time around the event loop.  Make sure we
check that before we start trying to use it.
This commit is contained in:
Andy Green 2022-02-09 11:59:06 +00:00
parent 1027d3a740
commit 3eae5f8bca

View file

@ -177,7 +177,7 @@ lws_ss_get_metadata(struct lws_ss_handle *h, const char *name,
return 0;
}
#if defined(LWS_WITH_SS_DIRECT_PROTOCOL_STR)
if (!(h->policy->flags & LWSSSPOLF_DIRECT_PROTO_STR))
if (!(h->policy->flags & LWSSSPOLF_DIRECT_PROTO_STR) || !h->wsi)
goto bail;
n = lws_http_string_to_known_header(name, strlen(name));