Wireshark-commits: [Wireshark-commits] master 560a6c3: Rawshark: Try to avoid a VC runtime crash.
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 17 Feb 2017 17:19:39 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=560a6c3823cf560b883e29db0a403517def86639
Submitter: Gerald Combs (gerald@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

560a6c3 by Gerald Combs (gerald@xxxxxxxxxxxxx):

    Rawshark: Try to avoid a VC runtime crash.
    
    The MSDN documentation for _read says
    
    "If fd is invalid, the file is not open for reading, or the file is
    locked, the invalid parameter handler is invoked, as described in
    Parameter Validation."
    
    This means that on Windows, if our parent has closed stdin when we call
    _read we'll crash. Add a check to bail out early if that's happened.
    
    Fix a sign cast while we're here.
    
    Change-Id: I8afb75f6e56c6a6c2b62103ba7e2fb635dc85702
    Reviewed-on: https://code.wireshark.org/review/20153
    Reviewed-by: Gerald Combs <gerald@xxxxxxxxxxxxx>
    

Actions performed:

    from  48eff6a   Bluetooth: AD: Add dissector for Apple iBeacon
    adds  560a6c3   Rawshark: Try to avoid a VC runtime crash.


Summary of changes:
 doc/rawshark.pod |    4 ++++
 rawshark.c       |   27 ++++++++++++++++++++++-----
 2 files changed, 26 insertions(+), 5 deletions(-)