Wireshark-commits: [Wireshark-commits] master-2.2 d185415: Rawshark: Try to avoid a VC runtime cras

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 18 Feb 2017 07:12:20 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=d185415c31941b88b260eed1a4ee64eaced41394
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

d185415 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>
    (cherry picked from commit 560a6c3823cf560b883e29db0a403517def86639)
    Reviewed-on: https://code.wireshark.org/review/20160
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    Petri-Dish: Michael Mann <mmann78@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  b88bb55   Qt: Warn the user about DBAR 1.8 on Windows.
    adds  d185415   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(-)