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:
parent
3775ac9d2e
commit
613ae7921a
1 changed files with 6 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue