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

coverity 188321: reject wsi with NULL vhost earlier

This commit is contained in:
Andy Green 2018-03-19 07:59:42 +08:00
parent ea8c44d799
commit da38a17a31

View file

@ -383,7 +383,10 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin,
int n;
wsi->handling_404 = 0;
if (wsi->vhost && wsi->vhost->error_document_404 &&
if (!wsi->vhost)
return -1;
if (wsi->vhost->error_document_404 &&
!strcmp(uri, wsi->vhost->error_document_404))
wsi->handling_404 = 1;