Open Rrooach opened 5 years ago
I fail to reproduce this with commit cbb0ab9c8fc6e8e3d3.
cd
to git folderexport CFLAGS="-g -fsanitize=address" LDFLAGS="-fsanitize=address"
./autogen.sh && ./configure && make
./tests/unit-test-server
netcat localhost 1502 < 1
I get the following output on the unit-test-server
and nothing else happens:
Client connection accepted from 127.0.0.1.
Waiting for an indication...
<00><00><00><00><00><0D><FF><17><01><60><00><20><00><00><00><01><02><12><34>
Illegal data read address 0x180 or write address 0x0 write_and_read_registers
[00][00][00][00][00][03][FF][97][02]
Waiting for an indication...
Well, okay, this reproduces with v3.1.6, as said by the title. So I can do a git bisect
. And this ends where basically all crash bisects end:
commit b4ef4c17d618eba0adccc4c7d9e9a1ef809fc9b6 (HEAD)
Author: Michael Heimpold <mhei@heimpold.de>
Date: Sat Jan 8 20:00:50 2022 +0100
modbus_reply: fix copy & paste error in sanity check (fixes #614)
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>
src/modbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Hello, I found a SEGV in stephane/libmodbus/unit-test-server.c.
Below are Steps Followed to Reproduce Crash Download latest source code from: stephane/libmodbus/unit-test-server.c, compiled with clang and ASAN
export CFLAGS="-g -fsanitize=address" LDFLAGS="-fsanitize=address"
before makeInput Data crash.zip
Crash Output