Wireshark-commits: [Wireshark-commits] master-3.2 012ec01: Add additional checks, clean up some stu

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 04 May 2020 19:07:41 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=012ec01729f844319e92f8710791495e3366e38c
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master-3.2
Repository: wireshark

Commits:

012ec01 by Guy Harris (guy@xxxxxxxxxxxx):

    Add additional checks, clean up some stuff.
    
    Add checks for bad block lengths - either too short or not a multiple of
    4.  (Yes, the pcapng spec requires it to be a multiple of 4.  And there
    is at least one implementation that requires it.)
    
    For various structures with a length field, create the top-level tree
    field for the item with a "run to the end of the packet" length and,
    once we're finished dissecting it, set the length to its actual value.
    
    Fetch various field values using proto_tree_item_add_uint.  Fix some
    incorrect field types based on errors reported by that.
    
    If an end-of-options option has a non-zero length, 1) don't treat it as
    not an end-of-options option and 2) report an error on its length.
    
    Change-Id: I72b2c065f3e3c76d5b71a1cd2ef3c1f497623266
    Reviewed-on: https://code.wireshark.org/review/36746
    Petri-Dish: Guy Harris <gharris@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
    (cherry picked from commit 0d2e6033ecad9c1e33239b5976a7c1b356fe4173)
    Reviewed-on: https://code.wireshark.org/review/37117
    

Actions performed:

    from  4a68e5c   Remove space that snuck in during editing.
     add  012ec01   Add additional checks, clean up some stuff.


Summary of changes:
 epan/dissectors/file-pcapng.c | 138 ++++++++++++++++++++++++++----------------
 1 file changed, 85 insertions(+), 53 deletions(-)