aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-05-20 10:54:40 -0700
committerGuy Harris <guy@alum.mit.edu>2017-05-20 17:56:05 +0000
commitab6abed1398e34a66139d02a5942b1247f0afa89 (patch)
treeaff4890fda2e7073923441cc18e42d772f39dd6f /plugins
parent6abff3174bb1b62744a91e18d28c95d877a44aa0 (diff)
If we don't have an ARUUID, don't use it as if we do.
Don't use random on-the-stack data as a UUID. Change-Id: I77961e1404ad73a484a7fc865bc54219dc239b4d Reviewed-on: https://code.wireshark.org/review/21721 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index 6252d86..9313937 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -8210,6 +8210,7 @@ dissect_ARBlockReq_block(tvbuff_t *tvb, int offset,
{
guint16 u16ARType;
guint32 u32ARProperties;
+ gboolean have_aruuid = FALSE;
e_guid_t aruuid;
e_guid_t uuid;
guint16 u16SessionKey;
@@ -8302,6 +8303,7 @@ dissect_ARBlockReq_block(tvbuff_t *tvb, int offset,
{
offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
hf_pn_io_ar_uuid, &aruuid);
+ have_aruuid = TRUE;
}
offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
hf_pn_io_sessionkey, &u16SessionKey);
@@ -8333,16 +8335,20 @@ dissect_ARBlockReq_block(tvbuff_t *tvb, int offset,
u16UDPRTPort,
pStationName);
- par = pnio_ar_find_by_aruuid(pinfo, &aruuid);
- if (par == NULL) {
- par = pnio_ar_new(&aruuid);
- memcpy( (void *) (&par->controllermac), mac, sizeof(par->controllermac));
- par->arType = u16ARType; /* store AR-type for filter generation */
- /*strncpy( (char *) (&par->controllername), pStationName, sizeof(par->controllername));*/
+ if (have_aruuid) {
+ par = pnio_ar_find_by_aruuid(pinfo, &aruuid);
+ if (par == NULL) {
+ par = pnio_ar_new(&aruuid);
+ memcpy( (void *) (&par->controllermac), mac, sizeof(par->controllermac));
+ par->arType = u16ARType; /* store AR-type for filter generation */
+ /*strncpy( (char *) (&par->controllername), pStationName, sizeof(par->controllername));*/
+ } else {
+ /*expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, "ARBlockReq: AR already existing!");*/
+ }
+ *ar = par;
} else {
- /*expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, "ARBlockReq: AR already existing!");*/
+ *ar = NULL;
}
- *ar = par;
return offset;
}