Files
asterisk/channels
George Joseph 989b9a24eb chan_websocket: Fix buffer overrun when processing TEXT websocket frames.
ast_websocket_read() receives data into a fixed 64K buffer then continually
reallocates a final buffer that, after all continuation frames have been
received, is the exact length of the data received and returns that to the
caller.  process_text_message() in chan_websocket was attempting to set a
NULL terminator on the received payload assuming the payload buffer it
received was the large 64K buffer.  The assumption was incorrect so when it
tried to set a NULL terminator on the payload, it could, depending on the
state of the heap at the time, cause heap corruption.

process_text_message() now allocates its own payload_len + 1 sized buffer,
copies the payload received from ast_websocket_read() into it then NULL
terminates it prevent the possibility of the overrun and corruption.

Resolves: #1384
(cherry picked from commit 076423aa18)
2025-09-17 14:04:27 -06:00
..
2021-11-19 09:02:06 -06:00
2025-01-23 18:36:03 +00:00
2025-03-20 18:18:29 +00:00
2025-03-20 18:18:29 +00:00
2025-03-20 18:18:29 +00:00
2025-03-20 18:18:29 +00:00