Ethereal-dev: Re: [Ethereal-dev] Re: New dissectors: H.223 and friends

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Richard van der Hoff <richardv@xxxxxxxxxxxxx>
Date: Fri, 07 Oct 2005 15:40:51 +0100
Guy Harris wrote:
Richard van der Hoff wrote:

yup, that seems fine. Sorry again for overlooking these - it's quite hard to spot them with a compiler that doesn't complain :(.


There's an assertion violation - it was causing a crash when the assertion was done with g_assert(), but dissectors should use DISSECTOR_ASSERT() so that, while dissection of the packet that provokes the dissector bug is aborted, procesing the capture file isn't. I've checked in a change to make it do so.

See bug 508:

    http://bugs.ethereal.com/bugzilla/show_bug.cgi?id=508

which has a capture file that provokes the problem attached.

Indeed. Sorry about that - try this patch. Looks like that will fix bugs 509 and 510 too.

Richard


--
Richard van der Hoff <richardv@xxxxxxxxxxxxx>
Systems Analyst
Tel: +44 (0) 845 666 7778
http://www.mxtelecom.com
Index: plugins/h223/packet-h223.c
===================================================================
RCS file: /cvs/ethereal/plugins/h223/packet-h223.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 packet-h223.c
--- plugins/h223/packet-h223.c	7 Oct 2005 12:37:35 -0000	1.1.1.2
+++ plugins/h223/packet-h223.c	7 Oct 2005 14:27:23 -0000
@@ -485,22 +485,30 @@
     return data;
 }
 
-void h223_set_mc( packet_info* pinfo, guint8 mc, h223_mux_element* me )
+static void h223_set_mc( packet_info* pinfo, guint8 mc, h223_mux_element* me )
 {
     circuit_t *circ = find_circuit( pinfo->ctype, pinfo->circuit_id, pinfo->fd->num );
     h223_vc_info* vc_info;
-    DISSECTOR_ASSERT( circ );
-    vc_info = circuit_get_proto_data(circ, proto_h223);
-    add_h223_mux_element( &(vc_info->call_info->direction_data[pinfo->p2p_dir]), mc, me, pinfo->fd->num );
+
+    /* if this h245 pdu packet came from an h223 circuit, add the details on
+     * the new mux entry */
+    if(circ) {
+        vc_info = circuit_get_proto_data(circ, proto_h223);
+        add_h223_mux_element( &(vc_info->call_info->direction_data[pinfo->p2p_dir]), mc, me, pinfo->fd->num );
+    }
 }
 
-void h223_add_lc( packet_info* pinfo, guint16 lc, h223_lc_params* params )
+static void h223_add_lc( packet_info* pinfo, guint16 lc, h223_lc_params* params )
 {
     circuit_t *circ = find_circuit( pinfo->ctype, pinfo->circuit_id, pinfo->fd->num );
     h223_vc_info* vc_info;
-    DISSECTOR_ASSERT( circ );
-    vc_info = circuit_get_proto_data(circ, proto_h223);
-    init_logical_channel( pinfo, vc_info->call_info, lc, pinfo->p2p_dir, params );
+
+    /* if this h245 pdu packet came from an h223 circuit, add the details on
+     * the new channel */
+    if(circ) {
+        vc_info = circuit_get_proto_data(circ, proto_h223);
+        init_logical_channel( pinfo, vc_info->call_info, lc, pinfo->p2p_dir, params );
+    }
 }
 
 /************************************************************************************