Accidentally connected two masters on one serial bus. This resulted in buffer overflows when calling nmbs_read_holding_registers()
Cause
Debugging found the possibility of buffer overflow in recv_read_registers_res(). Where quantity is not used to limit the amount of writes to registers.
Solution
Limit the for loop iterations or return error when (registers_bytes / 2) != quantity in recv_read_registers_res().
Situation
Accidentally connected two masters on one serial bus. This resulted in buffer overflows when calling nmbs_read_holding_registers()
Cause
Debugging found the possibility of buffer overflow in recv_read_registers_res(). Where quantity is not used to limit the amount of writes to registers.
Solution
Limit the for loop iterations or return error when (registers_bytes / 2) != quantity in recv_read_registers_res().