When doing remote capturing using WinPCap, dumpcap crashes inside the WinPCap

library when no capture filter is used. Then cfilter is NULL and 
capture_loop_init_filter() does not call compile_capture_filter() and
pcap_setfilter(). Providing an empty string instead of NULL works around
the problem.

svn path=/trunk/; revision=37588
This commit is contained in:
Michael Tüxen 2011-06-07 12:23:15 +00:00
parent 9164a7f892
commit 71325b8ac2
1 changed files with 6 additions and 1 deletions

View File

@ -3068,9 +3068,14 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i);
interface_opts = g_array_index(capture_opts->ifaces, interface_options, i);
/* init the input filter from the network interface (capture pipe will do nothing) */
/*
* When remote capturing WinPCap crashes when the capture filter
* is NULL. This might be a bug in WPCap. Therefore we provide an emtpy
* string.
*/
switch (capture_loop_init_filter(pcap_opts->pcap_h, pcap_opts->from_cap_pipe,
interface_opts.name,
interface_opts.cfilter)) {
interface_opts.cfilter?interface_opts.cfilter:"")) {
case INITFILTER_NO_ERROR:
break;