mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-03 08:25:47 +03:00
block.c: Correct size of allocated PDU buffer
Fix potential buffer overrun corruptions.
This commit is contained in:
1 parent
6a9a787503
commit
3d387a5be4
1 file changed
+1
-2
+1
-2
@@ -676,8 +676,7 @@ coap_add_data_large_internal(coap_session_t *session,
|
||||
if (!lg_xmit->pdu.token)
|
||||
goto fail;
|
||||
|
||||
lg_xmit->pdu.alloc_size = lg_xmit->pdu.used_size +
|
||||
lg_xmit->pdu.max_hdr_size;
|
||||
lg_xmit->pdu.alloc_size = lg_xmit->pdu.used_size;
|
||||
lg_xmit->pdu.token += lg_xmit->pdu.max_hdr_size;
|
||||
memcpy(lg_xmit->pdu.token, pdu->token, lg_xmit->pdu.used_size);
|
||||
if (pdu->data)
|
||||
|
||||
Reference in new issue
Block a user