mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-30 14:35:48 +03:00
coap_ws.c: Unmask server data on oversize header reads
This commit is contained in:
1 parent
46f3d82400
commit
f809315bbc
1 file changed
+4
@@ -741,6 +741,10 @@ coap_ws_read(coap_session_t *session, uint8_t *data, size_t datalen) {
|
||||
/* more information in header than given data size */
|
||||
memcpy(data, &session->ws->rd_header[2 + extra_hdr_len], bytes_size);
|
||||
session->ws->data_ofs = bytes_size;
|
||||
if (session->ws->state == COAP_SESSION_TYPE_SERVER) {
|
||||
/* Need to unmask the data */
|
||||
coap_ws_mask_data(session, data, bytes_size);
|
||||
}
|
||||
/* set up partial header for the next read */
|
||||
memmove(session->ws->rd_header,
|
||||
&session->ws->rd_header[2 + extra_hdr_len + bytes_size],
|
||||
|
||||
Reference in new issue
Block a user