tests: modbus: Fix potential memory overwrite (coverity)
Fixes #33816 Fixes #33811 Fixes #33793 Fixes #33797 Fixes #33796 Signed-off-by: David Leach <david.leach@nxp.com>
This commit is contained in:
parent
3f0da93902
commit
8272b32708
|
@ -26,7 +26,7 @@ int server_raw_cb(const int iface, const struct modbus_adu *adu)
|
|||
tmp_adu.unit_id = adu->unit_id;
|
||||
tmp_adu.fc = adu->fc;
|
||||
memcpy(tmp_adu.data, adu->data,
|
||||
MIN(adu->length, CONFIG_MODBUS_BUFFER_SIZE));
|
||||
MIN(adu->length, sizeof(tmp_adu.data)));
|
||||
|
||||
LOG_HEXDUMP_DBG(tmp_adu.data, tmp_adu.length, "resp");
|
||||
k_sem_give(&received);
|
||||
|
@ -51,7 +51,7 @@ int client_raw_cb(const int iface, const struct modbus_adu *adu)
|
|||
tmp_adu.unit_id = adu->unit_id;
|
||||
tmp_adu.fc = adu->fc;
|
||||
memcpy(tmp_adu.data, adu->data,
|
||||
MIN(adu->length, CONFIG_MODBUS_BUFFER_SIZE));
|
||||
MIN(adu->length, sizeof(tmp_adu.data)));
|
||||
|
||||
LOG_HEXDUMP_DBG(tmp_adu.data, tmp_adu.length, "c->s");
|
||||
|
||||
|
|
Loading…
Reference in New Issue