Added and extended Santeri Paavolainen's <santtu@ssh.fi> patch
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 29 Sep 1999 14:41:34 +0000 (14:41 +0000)
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 29 Sep 1999 14:41:34 +0000 (14:41 +0000)
to avoid applying NULL dfilters while setting colorization dfilters
during an ongoing, screen-updating, capture.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@734 f5534014-38df-0310-8fa8-9805f1628bb7

dfilter.c
file.c

index 916bf849c881ad0fb67b524dbc6de45988cfc251..2c115f0b53880338121dd30c836043e7b1509768 100644 (file)
--- a/dfilter.c
+++ b/dfilter.c
@@ -1,7 +1,7 @@
 /* dfilter.c
  * Routines for display filters
  *
- * $Id: dfilter.c,v 1.19 1999/08/30 16:01:42 gram Exp $
+ * $Id: dfilter.c,v 1.20 1999/09/29 14:41:33 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -329,6 +329,8 @@ gboolean
 dfilter_apply(dfilter *dfcode, proto_tree *ptree, const guint8* pd)
 {
        gboolean retval;
+       if (dfcode == NULL)
+               return FALSE;
        retval = dfilter_apply_node(dfcode->dftree, ptree, pd);
        return retval;
 }
diff --git a/file.c b/file.c
index fb9fe777d52434281e2d9169e0b9cd429a18bd96..97890c7b324b0ab6d4248add3dc456dbe2c23583 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
 /* file.c
  * File I/O routines
  *
- * $Id: file.c,v 1.98 1999/09/24 05:22:28 gram Exp $
+ * $Id: file.c,v 1.99 1999/09/29 14:41:34 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -522,6 +522,10 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, const u_char *buf
        color = -1;
         for(crow = 0; cf->colors->num_of_filters && 
              crow < cf->colors->num_of_filters; crow++) {
+
+            if(color_filter(cf,crow)->c_colorfilter == NULL) {
+               continue;
+           }
             if(dfilter_apply(color_filter(cf,crow)->c_colorfilter, protocol_tree,
                 cf->pd)){
                 color = crow;