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

coverity: 62458: coverity doesnt understand nonzero header length means simple_ptr cannot be NULL

This commit is contained in:
Andy Green 2020-08-18 09:15:09 +01:00
parent 9745c5cca8
commit 400355fdc3

View file

@ -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);