]> git.ipfire.org Git - thirdparty/suricata.git/commit
modbus: fix AddressSanitizer error (segmentation fault) 2069/head
authorDIALLO David <david.diallo@ssi.gouv.fr>
Wed, 4 May 2016 07:58:01 +0000 (09:58 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 9 May 2016 18:33:28 +0000 (20:33 +0200)
commit271bd045396b618cd52079be17ca083c4931f87e
tree88b50d48bd08263a78ab6ee1813d07e2e01b7580
parent79c1904ab24ccd8dd34c5847d4302431034633a4
modbus: fix AddressSanitizer error (segmentation fault)

In case of Mask Write register or Write single register request with
no data (malformed packet), app-layer-modbus checks response content
(data) with the none stored request content. That causes the segmentation
fault.

Before accessing to request content, app-layer-modbus checks now if
content has been previously stored. 4 unitests have been adding, 2 of them
to test the management of Mask Write register and Write single register requests,
and the 2 others to check invalid Mask Write register and Write single register
requests.
src/app-layer-modbus.c