stephane / libmodbus

A Modbus library for Linux, Mac OS, FreeBSD and Windows
http://libmodbus.org
GNU Lesser General Public License v2.1
3.44k stars 1.75k forks source link

modbus_reply: fix copy & paste error in sanity check (fixes #614) #619

Closed mhei closed 2 years ago

mhei commented 2 years ago

While handling MODBUS_FC_WRITE_AND_READ_REGISTERS, both address offsets must be checked, i.e. the read and the write address must be within the mapping range.

At the moment, only the read address was considered, it looks like a simple copy and paste error, so let's fix it.

Signed-off-by: Michael Heimpold mhei@heimpold.de

stephane commented 2 years ago

Thank you @mhei As usual, you rocks!