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:
parent
03c774e58c
commit
3ea5c2180a
1 changed files with 2 additions and 0 deletions
|
@ -992,6 +992,8 @@ int do_write_op_tlv(struct lwm2m_message *msg)
|
||||||
msg->operation == LWM2M_OP_CREATE))) {
|
msg->operation == LWM2M_OP_CREATE))) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue