From 400355fdc3ebe6521f58eb2a18c55951bee7b7b5 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 18 Aug 2020 09:15:09 +0100 Subject: [PATCH] coverity: 62458: coverity doesnt understand nonzero header length means simple_ptr cannot be NULL --- lib/roles/http/client/client-handshake.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 0b1ca96cb..e31053dde 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -1201,7 +1201,8 @@ lws_client_reset(struct lws **pwsi, int ssl, const char *address, int port, */ for (n = 0; n < (int)LWS_ARRAY_SIZE(hnames2); n++) - if (lws_hdr_total_length(wsi, hnames2[n])) { + if (lws_hdr_total_length(wsi, hnames2[n]) && + lws_hdr_simple_ptr(wsi, hnames2[n])) { memcpy(p, lws_hdr_simple_ptr(wsi, hnames2[n]), (size_t)( lws_hdr_total_length(wsi, hnames2[n]) + 1)); p += (size_t)(lws_hdr_total_length(wsi, hnames2[n]) + 1);