aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-01-31 01:32:51 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-01-31 01:32:51 +0000
commitdcf4e1a5c964e08482ed66ba18aa6afb59ba04c8 (patch)
tree68c38978f1b3cb2e962d73d9c9d7d0f0e0abc4f8 /capture.c
parent015d9900aca776904d35b3523919ccf09ddfad22 (diff)
If "pcap_compile()" fails to compile an empty filter string (because,
for example, the libpcap code generator doesn't support the link-layer type for the capture), "dfilter_compile()" will succeed but return a null rfcode pointer. In that case, instead of telling people that it looks like a valid display filter (which it does, but it also looks like a complete list of all the Basque words likely to be known by Hammurabi :-)), and then crashing when we try to "free" that non-existent dfilter code, we just report it as a "sorry, couldn't compile that capture filter. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9912 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/capture.c b/capture.c
index 8523d1db45..dd67340808 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.228 2004/01/25 21:55:09 guy Exp $
+ * $Id: capture.c,v 1.229 2004/01/31 01:32:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1532,7 +1532,7 @@ capture(gboolean *stats_known, struct pcap_stat *stats)
}
if (pcap_compile(pch, &fcode, cfile.cfilter, 1, netmask) < 0) {
dfilter_t *rfcode = NULL;
- if (dfilter_compile(cfile.cfilter, &rfcode)) {
+ if (dfilter_compile(cfile.cfilter, &rfcode) && rfcode != NULL) {
snprintf(errmsg, sizeof errmsg,
"Unable to parse capture filter string (%s).\n"
" Interestingly enough, this looks like a valid display filter\n"