mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
835571c0a7
Some calls to `coap_build_hdr()` were done with the target buffer for the header and the source buffer for the token overlapping: They reuse the buffer that held the request to assemble the response in. We cannot use `memcpy()` in this case to copy the token into the target buffer, as source and destination would (fully) overlap. This commit makes reusing the request buffer for the response a special case: `memcpy()` is only used to copy the token if source and destination address of the token differ. An alternative fix would have been to use `memmove()` unconditionally. But `memmove()` does not make any assumption about the layout of target and source buffer, while we know that the token either will already be at the right position (when reusing the request buffer for the response) or be in a non-overlapping buffer (when generating a fresh token). This approach is more efficient than `memmove()`. |
||
---|---|---|
.. | ||
application_layer | ||
ble | ||
credman | ||
crosslayer | ||
dsm | ||
gnrc | ||
link_layer | ||
lora | ||
netdev_test | ||
netif | ||
netstats | ||
netutils | ||
network_layer | ||
sock | ||
transport_layer | ||
doc.txt | ||
ieee802154.txt | ||
Kconfig |