Wireshark-commits: [Wireshark-commits] master 2fb9c82: androiddump: Read btsnoop header separately
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 27 Mar 2018 15:22:20 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=2fb9c8244eaf9d1066f3c86fefd69819fd9b96dc
Submitter: Michal Labedzki (michal.labedzki@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

2fb9c82 by Mikael Kanstrup (mikael.kanstrup@xxxxxxxxx):

    androiddump: Read btsnoop header separately from rest of data
    
    The code to read and skip btsnoop header was written in a way where
    it reads up to PACKET_LENGTH bytes of data, skips the header, then
    move rest of data back start of buffer. So far so good. The code
    then resets number of bytes used in buffer making it skip rest of
    all data read.
    
    Many times this works fine but only by luck. When there's no data
    transfers first recv call will always only return the header
    (sender side writes header separately right after accept).
    
    When data transfers are ongoing first recv call will return both
    header and data. Then initial data is lost but more importantly
    risk parsing data with invalid offset.
    
    Fix by reading btsnoop header separately from rest of data.
    
    Change-Id: Ie52c33f943d8b311e0cd5638ec1a7d4840e271b8
    Reviewed-on: https://code.wireshark.org/review/26659
    Petri-Dish: Anders Broman <a.broman58@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Michal Labedzki <michal.labedzki@xxxxxxxxxxxxx>
    

Actions performed:

    from  8503364   Diameter: Fix some xml errors.
    adds  2fb9c82   androiddump: Read btsnoop header separately from rest of data


Summary of changes:
 extcap/androiddump.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)