summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBirol Capa <birol.capa@siemens.com>2017-03-13 13:53:30 +0300
committerMichael Mann <mmann78@netscape.net>2017-03-14 12:21:48 +0000
commit20d7669bbe9ca84597a371dd605385f5b9c88154 (patch)
treee9cd0949ce2c28c73fec8f64ddd3e4d867499432 /plugins
parentb11d4e7ed00cf6bc877cb9a407dc0eadb10866c1 (diff)
downloadwireshark-20d7669bbe9ca84597a371dd605385f5b9c88154.tar.gz
PROFINET: Fix the Asset Management Record Dissection
Dissecting AMR doesn't work properly when AM_Location.Structure don't equal to 2. Bug: 13480 Change-Id: Ie116e10f6e88e240b2f1ae4e1eab27b24350e55a Reviewed-on: https://code.wireshark.org/review/20529 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Birol Capa <birol.capa@siemens.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index 6d37281763..986e5fe5fc 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -4470,7 +4470,7 @@ packet_info *pinfo, proto_tree *tree, guint8 *drep)
/* level 11 */
proto_tree_add_bits_item(sub_tree, hf_pn_io_am_location_level_11, tvb, bit_offset, 10, ENC_BIG_ENDIAN);
bit_offset += 10;
- offset += bit_offset*8;
+ offset = bit_offset >> 3;
break;
case (0x02):
/* Reserved1 */
@@ -4506,6 +4506,7 @@ packet_info *pinfo, proto_tree *tree, guint8 *drep)
hf_pn_io_am_location_reserved4, &am_location_reserved4);
break;
default: /* will not execute because of the line preceding the switch */
+ offset += 15;
break;
}
@@ -4583,7 +4584,7 @@ guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
}
/* align padding */
- offset = dissect_pn_align4(tvb, offset, pinfo, tree);
+ offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
/* IM_UniqueIdentifier */
offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
@@ -4645,7 +4646,7 @@ guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
}
/* align padding */
- offset = dissect_pn_align4(tvb, offset, pinfo, tree);
+ offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
/* IM_UniqueIdentifier */
offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
@@ -4698,7 +4699,7 @@ guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
return offset;
}
- offset = dissect_pn_align4(tvb, offset, pinfo, tree);
+ offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
/* IM_UniqueIdentifier */
offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,