diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-10-08 17:48:22 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-10-08 17:48:22 +0000 |
commit | 33f116a46d8b3c304f682e04b3c1abda21c30588 (patch) | |
tree | 725ad8a515564516d2b3f3ee8ea1953ee100a7f0 /epan/dissectors/packet-cisco-wids.c | |
parent | 7321549932137acdedf5216226e74094ac749ef5 (diff) |
Restore pinfo->private_data after an exception was thrown by a subdissector.
This is necessary in case a subdissector had changed it but was unable to
restore it (due to the exception).
Remove check_col().
svn path=/trunk/; revision=34436
Diffstat (limited to 'epan/dissectors/packet-cisco-wids.c')
-rw-r--r-- | epan/dissectors/packet-cisco-wids.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c index 90ad0556d7..9d448fe9a6 100644 --- a/epan/dissectors/packet-cisco-wids.c +++ b/epan/dissectors/packet-cisco-wids.c @@ -1,5 +1,5 @@ /* packet-cwids.c - * Routines for dissecting wireless ids packets sent from a Cisco + * Routines for dissecting wireless ids packets sent from a Cisco * access point to the WLSE (or whatever) * * $Id$ @@ -78,6 +78,7 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) volatile int offset = 0; guint16 capturelen; guint remain; + void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, "CWIDS"); col_set_str(pinfo->cinfo, COL_INFO, "Cwids: "); @@ -88,7 +89,7 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) while((remain = tvb_length_remaining(tvb, offset)) > 0) { ti = proto_tree_add_item(tree, proto_cwids, tvb, offset, 28, FALSE); cwids_tree = proto_item_add_subtree(ti, ett_cwids); - + proto_tree_add_item(cwids_tree, hf_cwids_version, tvb, offset, 2, FALSE); offset += 2; proto_tree_add_item(cwids_tree, hf_cwids_unknown1, tvb, offset, 7, FALSE); @@ -104,9 +105,10 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 2; proto_tree_add_item(cwids_tree, hf_cwids_unknown3, tvb, offset, 8, FALSE); offset += 8; - + wlan_tvb = tvb_new_subset(tvb, offset, capturelen, capturelen); /* Continue after ieee80211 dissection errors */ + pd_save = pinfo->private_data; TRY { call_dissector(ieee80211_handle, wlan_tvb, pinfo, tree); } CATCH2(BoundsError, ReportedBoundsError) { @@ -115,6 +117,12 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) PI_MALFORMED, PI_ERROR, "Malformed or short IEEE80211 subpacket"); + /* Restore the private_data structure in case one of the + * called dissectors modified it (and, due to the exception, + * was unable to restore it). + */ + pinfo->private_data = pd_save; + if (check_col(pinfo->cinfo, COL_INFO)) { col_append_str(pinfo->cinfo, COL_INFO, " [Malformed or short IEEE80211 subpacket] " ); @@ -124,7 +132,7 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) wlan_tvb = tvb_new_subset(tvb, offset, capturelen, capturelen); #if 0 /* FIXME: Why does this throw an exception? */ - proto_tree_add_text(cwids_tree, wlan_tvb, offset, capturelen, + proto_tree_add_text(cwids_tree, wlan_tvb, offset, capturelen, "[Malformed or short IEEE80211 subpacket]"); #endif ; |