1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/sys/net/application_layer
Benjamin Valentin 66fe083d9b nanocoap: always write at least 1 byte in coap_block2_finish()
The CoAP block option gets written twice:
First a 'dummy' value is written by `coap_opt_add_block2()`, later this gets
overwritten by the real option value by coap_block2_finish().

The problem arises when the size of the option changes.
If the option ends up smaller than the dummy, we have garbage bytes after the
real option value, corrupting the packet.

To mitigate this, always write at least one option byte (which will be a 0 byte)
to ensure the dummy data is overwritten.

fixes #20686
2024-09-07 16:11:23 +02:00
..
asymcute treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
cord treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
dhcpv6 net/dhcpv6: Improve option handling in dhcpv6 advertise 2024-07-30 19:21:09 +02:00
dns *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
emcute *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
gcoap Merge pull request #20836 from benpicco/sys/gcoap-thread_name 2024-08-27 08:56:50 +00:00
nanocoap nanocoap: always write at least 1 byte in coap_block2_finish() 2024-09-07 16:11:23 +02:00
sntp sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
sock_dns sock_dns_cache: move to dns_cache 2022-07-18 15:27:58 +02:00
sock_dns_mock sys/net/application_layer/sock_dns_mock: add module for mocking sock_dns 2022-04-03 17:29:10 +02:00
sock_dodtls *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
telnet treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
uhcp net/uhcp: convert to ztimer 2022-03-31 12:50:31 +02:00
doc.txt net/emcute : Update documentation 2020-11-19 23:11:21 +01:00
Kconfig sock_dodtls: Initial import of a DNS over DTLS client 2022-07-26 19:37:12 +02:00
Kconfig.coap *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00