Wireshark-commits: [Wireshark-commits] master c16db66: Various dissection improvements.
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 20 Aug 2014 21:25:13 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=c16db660837711aa8019916918c00457cea2a8cc
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

c16db66 by Guy Harris (guy@xxxxxxxxxxxx):

    Various dissection improvements.
    
    In WCCP V2, check whether the length field runs past the end of the
    packet (actual packet data, not captured data) and, if so, report an
    error with expert info, otherwise use the length field to set the length
    of the tvbuff.  That allows the dissector to just use the tvbuff checks
    to do length checks, so eliminate manual length checks.
    
    In find_wccp_address_table(), stop if we run past the reported length or
    packet length; if we fail to find an address table because we run past
    the captured length, we should probably note that if we're trying to
    dissect addresses.
    
    Don't do any other checks against the captured length, just throw the
    BoundsError assertion, to report that the packet was cut short during
    the capture process.
    
    When creating a protocol subtree for an item, give it a "to the end"
    initial length", and only set the length when we're finished dissecting
    the item, based on the amount of data dissected.
    
    Don't speak of dissectors in expert info - the user needn't know what a
    dissector is; what matters is what the protocol specifies.
    
    Properly report "item is too short" errors - those are indicated by item
    dissectors returning a negative value, so show the negative of that
    value.
    
    Make the top level item for a capability element be a separate item from
    the element type; use hf_capability_element_type for the type rather
    than the entire element, and put the type and length into the protocol
    tree in that order, as that's the order in which they appear in the
    packet.
    
    Don't do capability element length checks in the capability element
    dissector, do it in the dissector for the particular capability element,
    and don't fail with a dissector bug report, fail with an expert info.
    
    Sort the ett[] array to match the list of ett_ definitions, to make it
    easier to check that they're all registered.
    
    Change-Id: I6545e000b6caf9824f89234602635668fa1d38d6
    Reviewed-on: https://code.wireshark.org/review/3754
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  4ac0438   In Visual Studio builds, enable the L4 warning 4189: Local variable is initialized but not referenced
    adds  c16db66   Various dissection improvements.


Summary of changes:
 epan/dissectors/packet-wccp.c |  234 +++++++++++++++++++++--------------------
 1 file changed, 119 insertions(+), 115 deletions(-)