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:
parent
bfc8a5cb1b
commit
775f7bce09
1 changed files with 6 additions and 2 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue