diff options
author | Basak Kalfa <basakkalfa@gmail.com> | 2020-01-27 23:47:30 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-01-28 12:28:14 +0000 |
commit | 8f4cd818eedd3adc24de39f81ff29c9b6653ca64 (patch) | |
tree | f725bb23e4a2fc68ffb7b935e347d2da2916a1ec /plugins/epan | |
parent | ddc03b8c87b6b8c7438b43596a388a19910aad85 (diff) |
Profinet: Two new bugs are detected and fixed.
Bug at dissection of ARData is fixed. Moreover,
there is also bug in DCP's DHCP suboption and it
is also fixed.
Change-Id: I185e66f957f330dae587fc63b76cd50f567f5f9b
Reviewed-on: https://code.wireshark.org/review/35974
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins/epan')
-rw-r--r-- | plugins/epan/profinet/packet-dcerpc-pn-io.c | 4 | ||||
-rw-r--r-- | plugins/epan/profinet/packet-pn-dcp.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/epan/profinet/packet-dcerpc-pn-io.c b/plugins/epan/profinet/packet-dcerpc-pn-io.c index 2518e31e94..4c723f2eb1 100644 --- a/plugins/epan/profinet/packet-dcerpc-pn-io.c +++ b/plugins/epan/profinet/packet-dcerpc-pn-io.c @@ -7212,7 +7212,7 @@ dissect_ARData_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_number_of_apis, &u16NumberOfAPIs); /* API */ - if (u16NumberOfAPIs > 0) { + while (u16NumberOfAPIs--) { offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_api, &u32Api); } @@ -7330,7 +7330,7 @@ dissect_ARData_block(tvbuff_t *tvb, int offset, /* align to next 32 bit */ offset = dissect_pn_padding(tvb, offset, pinfo, ar_tree, 2); /* API */ - if (u16NumberOfAPIs > 0) { + while (u16NumberOfAPIs--) { offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_api, &u32Api); } /* get the number of subblocks an dissect them */ diff --git a/plugins/epan/profinet/packet-pn-dcp.c b/plugins/epan/profinet/packet-pn-dcp.c index f0d83f0fb3..fd3b394acd 100644 --- a/plugins/epan/profinet/packet-pn-dcp.c +++ b/plugins/epan/profinet/packet-pn-dcp.c @@ -968,7 +968,7 @@ dissect_PNDCP_Suboption_DHCP(tvbuff_t *tvb, int offset, packet_info *pinfo, * use its heuristics? */ proto_tree_add_item(tree, hf_pn_dcp_suboption_dhcp_arbitrary_client_id, tvb, offset, dhcpparameterlength - 1, ENC_ASCII|ENC_NA); - offset += dhcpparameterlength; + offset += (dhcpparameterlength-1); } } break; |