Skip to content

Commit 12559bf

Browse files
rlubosnashif
authored andcommitted
net: lwm2m: Prevent infinite loop in do_write_op_tlv function
In case unsopported TLV type or malformed packet is received, the `do_write_op_tlv` function will end up in an infinite loop. Prevent that by returning an error code in case it does not recognize TLV type. Signed-off-by: Robert Lubos <[email protected]>
1 parent c1af0c2 commit 12559bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subsys/net/lib/lwm2m/lwm2m_rw_oma_tlv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ int do_write_op_tlv(struct lwm2m_engine_obj *obj, struct lwm2m_message *msg)
949949
msg->operation == LWM2M_OP_CREATE))) {
950950
return ret;
951951
}
952+
} else {
953+
return -ENOTSUP;
952954
}
953955
}
954956

0 commit comments

Comments
 (0)