CIP: Highlight correct bytes in Req/Rsp processing
authorDylan Ulis <daulis0@gmail.com>
Wed, 7 Feb 2018 21:34:11 +0000 (16:34 -0500)
committerMichael Mann <mmann78@netscape.net>
Thu, 8 Feb 2018 23:41:12 +0000 (23:41 +0000)
commite4c5efafb7da2d25b7d47fe2dac3b1556c0b67b0
tree8e2b577782a9e11f0c459ab5ca04e00dad8acd35
parent60c5ec67f81393d979534c47a069c154277e477b
CIP: Highlight correct bytes in Req/Rsp processing

Previously, dissect_cip_generic_service_req and dissect_cip_generic_service_rsp
set lengths at different levels of the packet. In some cases, this would
cause a malformed packet when the data length was zero. This fixes the
malformed error by explicitly setting the length, instead of using -1.

The length of the service data set is not the data paylod for both
cases. Previously, for requests, it attempted to highlight the whole CIP
layer, but this was already covered by the full CIP protocol layer
length.

Change-Id: I4b4a99d30b9e04872fcf7ffb127c496e6062856c
Reviewed-on: https://code.wireshark.org/review/25672
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/dissectors/packet-cip.c