From 9f9dba9f209403c1e1ccf717b1252dd0e2bd799c Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Wed, 18 Dec 2019 14:45:31 +0000 Subject: [PATCH] close.c: close reason length wrong The string length is actually 25... solve it by measuring the same string. --- lib/core-net/close.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core-net/close.c b/lib/core-net/close.c index 4162702d2..95f2201ef 100644 --- a/lib/core-net/close.c +++ b/lib/core-net/close.c @@ -376,9 +376,12 @@ just_kill_connection: #if !defined(LWS_NO_CLIENT) if ((lwsi_state(wsi) == LRS_WAITING_SERVER_REPLY || lwsi_state(wsi) == LRS_WAITING_CONNECT) && - !wsi->already_did_cce && wsi->protocol) + !wsi->already_did_cce && wsi->protocol) { + static const char _reason[] = "closed before established"; + lws_inform_client_conn_fail(wsi, - (void *)"closed before established", 24); + (void *)_reason, sizeof(_reason)); + } #endif /*