diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-04-29 14:40:04 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-04-29 14:40:04 +0000 |
commit | ffd92a2a5972ff3744607dbff03a702abbb44436 (patch) | |
tree | 48b894072a94a13e36b4e4b4fd7c632e2e3ee094 /epan/dissectors/packet-dhcp-failover.c | |
parent | 5ac633590bfd66ffb9a7879d9c321ecd82e0d894 (diff) |
Make sure we're passing the proper lengths to proto_tree_add_item(). Fixes
bug 142.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14230 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dhcp-failover.c')
-rw-r--r-- | epan/dissectors/packet-dhcp-failover.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c index ea1eb54d4d..dd663e79f2 100644 --- a/epan/dissectors/packet-dhcp-failover.c +++ b/epan/dissectors/packet-dhcp-failover.c @@ -529,6 +529,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item_append_text(oi, ", %s ", assigned_ip_address_str); + if (helpliste->length != 4) + THROW(ReportedBoundsError); proto_tree_add_item(option_tree, hf_dhcpfo_assigned_ip_address, tvb, helpliste->actualpoffset + 4, @@ -541,6 +543,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item_append_text(oi, ", %s ", sending_server_ip_address_str); + if (helpliste->length != 4) + THROW(ReportedBoundsError); proto_tree_add_item(option_tree, hf_dhcpfo_sending_server_ip_address, tvb, helpliste->actualpoffset + 4, @@ -553,6 +557,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) helpliste->actualpoffset+4); proto_item_append_text(oi,", %d",addresses_transfered); + if (helpliste->length != 1) + THROW(ReportedBoundsError); proto_tree_add_item(option_tree, hf_dhcpfo_addresses_transfered, tvb, helpliste->actualpoffset + 4, @@ -616,6 +622,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) reject_reason_str, reject_reason); + if (helpliste->length != 1) + THROW(ReportedBoundsError); proto_tree_add_item(option_tree, hf_dhcpfo_reject_reason, tvb, helpliste->actualpoffset +4, @@ -634,6 +642,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) mclt = tvb_get_ntohl(tvb, helpliste->actualpoffset+4); proto_item_append_text(oi,", %d seconds",mclt); + if (helpliste->length != 4) + THROW(ReportedBoundsError); proto_tree_add_item(option_tree, hf_dhcpfo_mclt, tvb, helpliste->actualpoffset +4, @@ -812,6 +822,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_get_ntohl(tvb,helpliste->actualpoffset+4); proto_item_append_text(oi,", %d", max_unacked_bndupd); + if (helpliste->length != 1) + THROW(ReportedBoundsError); proto_tree_add_item(option_tree, hf_dhcpfo_max_unacked_bndupd, tvb, helpliste->actualpoffset + 4, @@ -824,6 +836,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_get_ntohl(tvb,helpliste->actualpoffset+4); proto_item_append_text(oi,", %d seconds", receive_timer); + if (helpliste->length != 1) + THROW(ReportedBoundsError); receive_timer_item = proto_tree_add_item(option_tree, hf_dhcpfo_receive_timer, tvb, helpliste->actualpoffset + 4, @@ -866,6 +880,8 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item_append_text(oi, ", version: %d", protocol_version); + if (helpliste->length != 1) + THROW(ReportedBoundsError); proto_tree_add_item(option_tree, hf_dhcpfo_protocol_version, tvb, helpliste->actualpoffset + 4, |