aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iax2.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-08-12 07:47:27 +0000
committerGuy Harris <guy@alum.mit.edu>2005-08-12 07:47:27 +0000
commit960f9cb5e7e95435f6550a5af22529fef4ee8b35 (patch)
tree2bda428c47967e79bdba9d57a127424a29c30e20 /epan/dissectors/packet-iax2.c
parent86b69226042d2ae3c14b268303f212ec5dc379e3 (diff)
In an "address" structure, "data" is a pointer; dereferencing "&data"
doesn't give you the address value, it gives a pointer to the address value. Don't assume that pointer is aligned on a 32-bit boundary. svn path=/trunk/; revision=15300
Diffstat (limited to 'epan/dissectors/packet-iax2.c')
-rw-r--r--epan/dissectors/packet-iax2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index a07d10e2c8..bd9af15823 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1136,14 +1136,16 @@ static guint32 dissect_ies (tvbuff_t * tvb, guint32 offset,
/* these come from linux/socket.h */
case 2: /* AF_INET */
{
- /* the ip address is big-endian, but then so is address.data */
- SET_ADDRESS(&ie_data->peer_address,AT_IPv4,4,tvb_get_ptr(tvb,offset+6,4));
+ guint32 addr;
/* IAX is always over UDP */
ie_data->peer_ptype = PT_UDP;
ie_data->peer_port = tvb_get_ntohs(tvb, offset+4);
proto_tree_add_uint(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINPORT, tvb, offset + 4, 2, ie_data->peer_port);
- proto_tree_add_ipv4(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINADDR, tvb, offset + 6, 4, *(guint32 *)(&ie_data->peer_address.data));
+ /* the ip address is big-endian, but then so is address.data */
+ SET_ADDRESS(&ie_data->peer_address,AT_IPv4,4,tvb_get_ptr(tvb,offset+6,4));
+ memcpy(&addr, ie_data->peer_address.data, 4);
+ proto_tree_add_ipv4(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINADDR, tvb, offset + 6, 4, addr);
break;
}