diff options
author | Evan Huus <eapache@gmail.com> | 2013-07-16 01:42:26 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-07-16 01:42:26 +0000 |
commit | df77b38e6e0948ab39d7fba1d1dc890dfaf68b73 (patch) | |
tree | 63ef53b31abe55e571031700a5658816d0485fd2 /plugins | |
parent | 2d30d5beb13d0ab9485c05186ad8ddf7a808ef58 (diff) |
Bail in the profinet heuristics if we don't have source and destination mac
addresses. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8904
svn path=/trunk/; revision=50651
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/profinet/packet-pn-rt.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c index c177e28568..e86832f28d 100644 --- a/plugins/profinet/packet-pn-rt.c +++ b/plugins/profinet/packet-pn-rt.c @@ -172,7 +172,13 @@ IsDFP_Frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* the sub tvb will NOT contain the frame_id here! */ u16FrameID = GPOINTER_TO_UINT(pinfo->private_data); - /* try to bild a temporaray buffer for generating this CRC */ + /* try to build a temporaray buffer for generating this CRC */ + if (!pinfo->src.data || !pinfo->dst.data || + pinfo->dst.type != AT_ETHER || pinfo->src.type != AT_ETHER) { + /* if we don't have src/dst mac addresses then we assume it's not + * to avoid various crashes */ + return FALSE; + } memcpy(&virtualFramebuffer[0], pinfo->dst.data, 6); memcpy(&virtualFramebuffer[6], pinfo->src.data, 6); virtualFramebuffer[12] = 0x88; |