diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2002-02-11 19:02:56 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2002-02-11 19:02:56 +0000 |
commit | 9249d8094f32cb73c2f48da24e18ff08afa9ea16 (patch) | |
tree | 212df4666c8b6911e1269ebd40ec751051048310 /epan | |
parent | 04228a94a315d27ab0e590d31fc799eb80153a4d (diff) | |
download | wireshark-9249d8094f32cb73c2f48da24e18ff08afa9ea16.tar.gz wireshark-9249d8094f32cb73c2f48da24e18ff08afa9ea16.tar.bz2 wireshark-9249d8094f32cb73c2f48da24e18ff08afa9ea16.zip |
dissect_frame() can throw a ReportedBoundsError; catch it in
dissect_packet().
svn path=/trunk/; revision=4720
Diffstat (limited to 'epan')
-rw-r--r-- | epan/packet.c | 13 |
1 files 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 <gerald@ethereal.com> @@ -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; } |