Wireshark-commits: [Wireshark-commits] master-2.6 f806b00: Add additional checks, clean up some stu

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

Commits:

f806b00 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/37119
    

Actions performed:

    from  d7f219c   Remove space that snuck in during editing.
     add  f806b00   Add additional checks, clean up some stuff.


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