From 4a28bc8c87360436dbf393e0b1a754f285e528cb Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 14 Aug 2020 07:27:08 +0100 Subject: [PATCH] coverity: 231739: clear false positive by needless checks Client connection api must provide host --- lib/roles/h2/http2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/roles/h2/http2.c b/lib/roles/h2/http2.c index 430849e03..a102788b4 100644 --- a/lib/roles/h2/http2.c +++ b/lib/roles/h2/http2.c @@ -2398,6 +2398,8 @@ lws_h2_client_handshake(struct lws *wsi) goto fail_length; if (!wsi->client_h2_alpn && + lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_HOST) && /* coverity */ + lws_hdr_total_length(wsi, _WSI_TOKEN_CLIENT_HOST) && /* coverity */ lws_add_http_header_by_token(wsi, WSI_TOKEN_HOST, (unsigned char *)lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_HOST),