aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2018-10-14 20:22:08 +0200
committerRoland Knall <rknall@gmail.com>2018-10-14 19:05:27 +0000
commitf86d6203a93f2b84b771c2d21e8a6dd24adfdca8 (patch)
treeba0e5add9917f84e3a0b13c5533bb4e36d56d374 /extcap.c
parent674a57ab73dba2551c6b1e2e952b3faf635f3a7f (diff)
extcap: Read stderr on extcap error without an infinite loop
Check if data is available on stderr before doing a blocking read() to avoid an infinite read loop when having less data than STDERR_BUFFER_SIZE. Append data instead of overwrite when doing multiple read() to fetch available data. This is a regression from g6a949ed155. Bug: 15205 Change-Id: I84b232aeafb6123f77f3f5d48bbe89326fe7eb0f Reviewed-on: https://code.wireshark.org/review/30209 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap.c')
-rw-r--r--extcap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extcap.c b/extcap.c
index 1744655685..bcbc9a8c9a 100644
--- a/extcap.c
+++ b/extcap.c
@@ -1131,7 +1131,7 @@ void extcap_if_cleanup(capture_options *capture_opts, gchar **errormsg)
pipedata = (ws_pipe_t *) interface_opts->extcap_pipedata;
if (pipedata)
{
- if (pipedata->stderr_fd > 0 && ws_pipe_data_available(pipedata->stderr_fd))
+ if (pipedata->stderr_fd > 0)
{
buffer = (gchar *)g_malloc0(STDERR_BUFFER_SIZE + 1);
ws_read_string_from_pipe(ws_get_pipe_handle(pipedata->stderr_fd), buffer, STDERR_BUFFER_SIZE + 1);