Wireshark-commits: [Wireshark-commits] master d84e46f: CIP: Properly handle EPATH attributes that d

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 15 Nov 2016 17:29:13 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=d84e46ff1004018f88be6011f11f70dce4e3227b
Submitter: Michael Mann (mmann78@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

d84e46f by D. Ulis (daulis0@xxxxxxxxx):

    CIP: Properly handle EPATH attributes that do not specify path size
    
    Most attributes specify the path length before the EPATH data, but some do not. The previous code for parsing EPATHs just looped until there was no more data. This is a problem for EPATH that do not specify a length, because it will eat up too many bytes. This mainly affects Get Attribute List Responses and Set Attribute List Requests. For the small number of attributes like this, the Spec says exactly what kind of segment should be in the EPATH, so just parse a single segment.
    
    This fixes: Port attributes: 'Port Number and Node Address' and 'Chassis Identity'
    There is still one that is a problem in packet-cipsafety.c, but we will have to deal with it later. See the TODO in that file.
    
    I use the .pcap attached to https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=12049, to make sure I didn't break any existing path/segment handling.
    
    Ping-Bug: 12049
    Change-Id: Id035f9809f6cc747ea7b6327d94dd26dc66cb466
    Reviewed-on: https://code.wireshark.org/review/18675
    Petri-Dish: Michael Mann <mmann78@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    

Actions performed:

    from  0623789   [SIP export-pdu] Don't export SIP messages from the body of another SIP message
    adds  d84e46f   CIP: Properly handle EPATH attributes that do not specify path size


Summary of changes:
 epan/dissectors/packet-cip.c |  243 ++++++++++++++++++++++++------------------
 epan/dissectors/packet-cip.h |    5 -
 2 files changed, 139 insertions(+), 109 deletions(-)