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

coverity 188314: reject wsi with NULL vhost earlier

This commit is contained in:
Andy Green 2018-03-19 07:57:13 +08:00
parent 3775ac9d2e
commit 613ae7921a

View file

@ -233,8 +233,12 @@ lws_return_http_status(struct lws *wsi, unsigned int code,
int n = 0, m = 0, len;
char slen[20];
if (wsi->vhost &&
!wsi->handling_404 &&
if (!wsi->vhost) {
lwsl_err("%s: wsi not bound to vhost\n", __func__);
return 1;
}
if (!wsi->handling_404 &&
wsi->vhost->error_document_404 &&
code == HTTP_STATUS_NOT_FOUND)
/* we should do a redirect, and do the 404 there */