Skip to content

Commit 828f5e8

Browse files
jakubwitowskifabiobaltieri
authored andcommitted
net: coap: fix uninitialized usage of hdr_len
The hdr_len was uninitialized when none of if-else conditions were met in decode_delta() function. Signed-off-by: Jakub Witowski <jakub.witowski9302@gmail.com>
1 parent cc33491 commit 828f5e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/lib/coap/coap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ static int decode_delta(uint8_t *data, uint16_t offset, uint16_t *pos, uint16_t
498498
uint16_t opt, uint16_t *opt_ext, uint16_t *hdr_len)
499499
{
500500
int ret = 0;
501+
*hdr_len = 0;
501502

502503
if (opt == COAP_OPTION_EXT_13) {
503504
uint8_t val;

0 commit comments

Comments
 (0)