net: lwm2m: fix buffer length check in lwm2m_engine_set
Previously, lwm2m_engine set would check against the max_data_len parameter of the ressource, but didn't take into consideration the (possibly changed) max_data_len returned by the pre_write callback. Fixes #30541 Signed-off-by: Henning Fleddermann <henning.fleddermann@grandcentrix.net>
This commit is contained in:
parent
c45e7f3c96
commit
061de0376a
1 changed files with 1 additions and 1 deletions
|
@ -1487,7 +1487,7 @@ static int lwm2m_engine_set(char *pathstr, void *value, uint16_t len)
|
|||
}
|
||||
|
||||
/* check length (note: we add 1 to string length for NULL pad) */
|
||||
if (len > res_inst->max_data_len -
|
||||
if (len > max_data_len -
|
||||
(obj_field->data_type == LWM2M_RES_TYPE_STRING ? 1 : 0)) {
|
||||
LOG_ERR("length %u is too long for res instance %d data",
|
||||
len, path.res_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue