Wireshark-commits: [Wireshark-commits] master-3.0 b4ed0c4: Fix the heuristic for checking whether i

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 12 Apr 2020 04:14:07 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b4ed0c4f293edc6b47b8d8dc475c697c6ed76550
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master-3.0
Repository: wireshark

Commits:

b4ed0c4 by Guy Harris (guy@xxxxxxxxxxxx):

    Fix the heuristic for checking whether it's a CAM Inspector file.
    
    wtap_read_bytes() returns TRUE on *success*, so if we're in the loop,
    the last read succeeded, and no error code was supplied.  When we *exit*
    the loop, the read didn't succeed; check for the status then.  If we got
    a short read, we ran out of file data, so check the heuristics (even if
    it's not an integral number of 2-byte blocks, treat it as a CAM
    Inspector file - it might have gotten cut short); if we got a real read
    error, report that to our caller.
    
    Bug: 16458
    Change-Id: Ia1e838006744dadbc2883459aec16d0d11b732e1
    Reviewed-on: https://code.wireshark.org/review/36795
    Petri-Dish: Guy Harris <gharris@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
    (cherry picked from commit d8615d27b4ff168bc438576ca94fd41192579256)
    Reviewed-on: https://code.wireshark.org/review/36797
    

Actions performed:

    from  2661b33   lanalyzer: Make sure a LANalyzer file has exactly one summary record.
     add  b4ed0c4   Fix the heuristic for checking whether it's a CAM Inspector file.


Summary of changes:
 wiretap/camins.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)