Wireshark-commits: [Wireshark-commits] master-2.0 d0a0516: Rawshark: Try to avoid a VC runtime cras
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=d0a05163353266f26d18f3895c2b130d5c8d963d
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master-2.0
Repository: wireshark
Commits:
d0a0516 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)
(cherry picked from commit 154147e01cee18102cb6ac8ce871befdd6dff1ce)
Reviewed-on: https://code.wireshark.org/review/20161
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 b29a4f0 Qt: Warn the user about DBAR 1.8 on Windows.
adds d0a0516 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(-)