Skip to content
Commit 16fa99a8 authored by Robert Lubos's avatar Robert Lubos Committed by Anas Nashif
Browse files

net: coap: Validate token length in coap_header_get_token()



In theory, coap_header_get_token() should only be used on already parsed
packets, and coap_packet_parse() would detect an invalid token length in
a packet. Coverity however complains about possible out-of-bound access,
as in theory the function can return token length up to 15. Therefore
add an extra validation of the token length within the function, to
avoid out-of-bound access due to programming errors and to make Coverity
happy.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent dd09b04d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment