From 9249d8094f32cb73c2f48da24e18ff08afa9ea16 Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Mon, 11 Feb 2002 19:02:56 +0000 Subject: [PATCH] dissect_frame() can throw a ReportedBoundsError; catch it in dissect_packet(). svn path=/trunk/; revision=4720 --- epan/packet.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/epan/packet.c b/epan/packet.c index 4389353a86..7a3ac78984 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.57 2002/01/17 06:29:20 guy Exp $ + * $Id: packet.c,v 1.58 2002/02/11 19:02:56 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -223,6 +223,14 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, edt->tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len, "Frame"); /* Add this tvbuffer into the data_src list */ fd->data_src = g_slist_append( fd->data_src, edt->tvb); + + /* Even though dissect_frame() catches all the exceptions a + * sub-dissector can throw, dissect_frame() itself may throw + * a ReportedBoundsError in bizarre cases. Thus, we catch the exception + * in this function. */ + if(frame_handle != NULL) + call_dissector(frame_handle, edt->tvb, &edt->pi, edt->tree); + } CATCH(BoundsError) { g_assert_not_reached(); @@ -238,9 +246,6 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, } ENDTRY; - if(frame_handle != NULL) - call_dissector(frame_handle, edt->tvb, &edt->pi, edt->tree); - fd->flags.visited = 1; }