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

coverity 188313: client: avoid possibility of strlen on NULL cce

This commit is contained in:
Andy Green 2018-03-19 08:05:37 +08:00
parent bfc8a5cb1b
commit 775f7bce09

View file

@ -1171,11 +1171,15 @@ bail3:
close_reason = LWS_CLOSE_STATUS_NOSTATUS;
bail2:
if (wsi->protocol)
if (wsi->protocol) {
n = 0;
if (cce)
n = strlen(cce);
wsi->protocol->callback(wsi,
LWS_CALLBACK_CLIENT_CONNECTION_ERROR,
wsi->user_space, (void *)cce,
(unsigned int)strlen(cce));
(unsigned int)n);
}
wsi->already_did_cce = 1;
lwsl_info("closing connection due to bail2 connection error\n");