summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-isns.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-07-01 21:04:13 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-07-01 21:04:13 +0000
commit2ce8d2a30f519ad93ef8aaf2e29fcc96ab95c2dd (patch)
treec5e1bcc1278dd9072b28d40e266c7a3cae57830c /epan/dissectors/packet-isns.c
parent22fff1e1f308ed3849c3dddd15eff189bb7326ea (diff)
downloadwireshark-2ce8d2a30f519ad93ef8aaf2e29fcc96ab95c2dd.tar.gz
fixed various issues (two serious ones) found by "private" fuzz-testing
svn path=/trunk/; revision=14830
Diffstat (limited to 'epan/dissectors/packet-isns.c')
-rw-r--r--epan/dissectors/packet-isns.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/dissectors/packet-isns.c b/epan/dissectors/packet-isns.c
index fc41e4f75f..28700096e3 100644
--- a/epan/dissectors/packet-isns.c
+++ b/epan/dissectors/packet-isns.c
@@ -1121,6 +1121,8 @@ AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset,
return (offset+8);
}
+ tvb_ensure_bytes_exist(tvb, offset, len);
+
switch( tag )
{
case ISNS_ATTR_TAG_DELIMITER:
@@ -1133,9 +1135,11 @@ AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset,
offset = dissect_isns_attr_integer(tvb, offset, tree, hf_isns_entity_protocol, tag, len, function_id);
break;
case ISNS_ATTR_TAG_MGMT_IP_ADDRESS:
+ if(len != 16) THROW(ReportedBoundsError);
offset = dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_mgmt_ip_addr, tag, len);
break;
case ISNS_ATTR_TAG_TIMESTAMP:
+ if(len != 8) THROW(ReportedBoundsError);
offset = dissect_isns_attr_integer(tvb, offset, tree, hf_isns_timestamp, tag, len, function_id);
break;
case ISNS_ATTR_TAG_PROTOCOL_VERSION_RANGE:
@@ -1157,6 +1161,7 @@ AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset,
offset = dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
break;
case ISNS_ATTR_TAG_PORTAL_IP_ADDRESS:
+ if(len != 16) THROW(ReportedBoundsError);
offset = dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_portal_ip_addr, tag, len);
break;
case ISNS_ATTR_TAG_PORTAL_PORT:
@@ -1220,6 +1225,7 @@ AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset,
offset = dissect_isns_attr_string(tvb, offset, tree, hf_isns_pg_iscsi_name, tag, len);
break;
case ISNS_ATTR_TAG_PG_PORTAL_IP_ADDR:
+ if(len != 16) THROW(ReportedBoundsError);
offset = dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_pg_portal_ip_addr, tag, len);
break;
case ISNS_ATTR_TAG_PG_PORTAL_PORT: