iot/zoap: Fix decoding of 16-bit delta
When an option code or length representation is encoded in a 16-bit value, the access was wrong. Coverity-CID: 151963 Change-Id: Ie7741998cbde348ccf490a6686e68a1ace99920e Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This commit is contained in:
parent
8f0057a05f
commit
777d57dbfb
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ static int decode_delta(int num, const uint8_t *buf, int16_t buflen,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
num = sys_be16_to_cpu((uint16_t)*buf) + 269;
|
||||
num = sys_get_be16(buf) + 269;
|
||||
hdrlen += 2;
|
||||
break;
|
||||
case 15:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue