From 560a6c3823cf560b883e29db0a403517def86639 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 16 Feb 2017 15:31:56 -0800 Subject: 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 --- doc/rawshark.pod | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/rawshark.pod b/doc/rawshark.pod index c2c722a2bb..9119839591 100644 --- a/doc/rawshark.pod +++ b/doc/rawshark.pod @@ -199,6 +199,10 @@ Read packet data from I. It can be either the name of a FIFO (named pipe) or ``-'' to read data from the standard input, and must have the record format specified above. +If you are sending data to rawshark from a parent process on Windows you +should not close rawshark's standard input handle prematurely, otherwise +the C runtime might trigger an exception. + =item -R Eread (display) filterE Cause the specified filter (which uses the syntax of read/display filters, -- cgit v1.2.1