Answers checklist.
General issue report
Component
Name: esp_websocket_client
Version: 1.6.1
Description
esp_websocket_client_send_fin() calls esp_websocket_client_send_with_exact_opcode(client, WS_TRANSPORT_OPCODES_FIN, NULL, 0, timeout).
The NULL guard at line ~662 permits data == NULL when len == 0, but the while (widx < len || opcode) loop at ~698 still executes when opcode != 0, reaching memcpy(client->tx_buffer, data + widx, need_write) with a NULL source pointer — UB per C11 §7.1.4.
Found by: Clang static analyzer (-Wanalyzer-null-argument)
Answers checklist.
General issue report
Component
Name: esp_websocket_client
Version: 1.6.1
Description
esp_websocket_client_send_fin()callsesp_websocket_client_send_with_exact_opcode(client, WS_TRANSPORT_OPCODES_FIN, NULL, 0, timeout).The NULL guard at line ~662 permits
data == NULLwhenlen == 0, but thewhile (widx < len || opcode)loop at ~698 still executes when opcode != 0, reachingmemcpy(client->tx_buffer, data + widx, need_write)with a NULL source pointer — UB per C11 §7.1.4.Found by: Clang static analyzer (-Wanalyzer-null-argument)