Skip to content

Commit a907409

Browse files
committed
close: trim length of reason
In the case of "closed before connection", we need to use sizeof(_reason) - 1 #3380
1 parent 7e80631 commit a907409

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core-net/close.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason,
650650
wsi->socket_is_permanently_unusable = 1;
651651

652652
lws_inform_client_conn_fail(wsi,
653-
(void *)_reason, sizeof(_reason));
653+
(void *)_reason, sizeof(_reason) - 1);
654654
}
655655
#endif
656656

0 commit comments

Comments
 (0)