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 <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2020-07-01 13:52:19 +02:00 committed by Anas Nashif
commit 3ea5c2180a

View file

@ -992,6 +992,8 @@ int do_write_op_tlv(struct lwm2m_message *msg)
msg->operation == LWM2M_OP_CREATE))) {
return ret;
}
} else {
return -ENOTSUP;
}
}