aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-igrp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-04-26 00:01:29 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-04-26 00:01:29 +0000
commit94bf3360aef12f2a2930b5d97902c7826cd9efcf (patch)
tree53f86e2c04156fcf08e5225de2c418c9cd38318c /epan/dissectors/packet-igrp.c
parent0650dd381fa754fd9848509b8c7b263835fda42f (diff)
Check to make sure the address really *is* an IPv4 address.
If it is, convert the "void *" data pointer to a "guint8 *", so we can look at the first byte. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21575 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-igrp.c')
-rw-r--r--epan/dissectors/packet-igrp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/epan/dissectors/packet-igrp.c b/epan/dissectors/packet-igrp.c
index fb0d709da0..fc95252a8b 100644
--- a/epan/dissectors/packet-igrp.c
+++ b/epan/dissectors/packet-igrp.c
@@ -56,6 +56,7 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 ver_and_opcode,version,opcode,update,network;
gint offset=IGRP_HEADER_LENGTH;
guint16 as,net1,net2,net3;
+ const guint8 *ipsrc;
proto_item *ti;
proto_tree *igrp_tree, *igrp_vektor_tree;
tvbuff_t *next_tvb;
@@ -105,7 +106,9 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
net3 = tvb_get_ntohs(tvb,8);
/* this is a ugly hack to find the first byte of the IP source address */
- network = pinfo->net_src.data[0];
+ DISSECTOR_ASSERT(pinfo->net_src.type == AT_IPv4);
+ ipsrc = pinfo->net_src.data;
+ network = ipsrc[0];
ti = proto_tree_add_text(igrp_tree, tvb, 4,2,"Interior routes : %d",net1);
for( ; net1>0 ; net1-- )