aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/ethercat
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-06-05 15:43:10 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2015-06-05 21:15:37 +0000
commit1ec868edddbca60e367f0681db8a5ee5aa32fe74 (patch)
tree2759a88e2b6bc3291b76f29894edde31c2b61124 /plugins/ethercat
parent244f2fbbf6c4167c75c4eb626aa8a73208ba3d8e (diff)
Fix a few issues reported by PVS-Studio
See http://www.viva64.com/en/b/0328/ for details Change-Id: Ic9ddfd690b49401c96cb8a4a277c671f9824be31 Reviewed-on: https://code.wireshark.org/review/8775 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'plugins/ethercat')
-rw-r--r--plugins/ethercat/packet-ethercat-datagram.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c
index cdb0ccb0c0..cd7761b49d 100644
--- a/plugins/ethercat/packet-ethercat-datagram.c
+++ b/plugins/ethercat/packet-ethercat-datagram.c
@@ -514,7 +514,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
subsize = get_cmd_len(&ecHdr);
len = ecHdr.len & 0x07ff;
- if ( len >= sizeof(ETHERCAT_MBOX_HEADER_LEN) &&
+ if ( len >= ETHERCAT_MBOX_HEADER_LEN &&
(ecHdr.cmd==EC_CMD_TYPE_FPWR || ecHdr.cmd==EC_CMD_TYPE_FPRD || ecHdr.cmd==EC_CMD_TYPE_APWR || ecHdr.cmd==EC_CMD_TYPE_APRD) &&
ecHdr.anAddrUnion.a.ado>=0x1000
)
@@ -528,7 +528,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
case ETHERCAT_MBOX_TYPE_FOE:
case ETHERCAT_MBOX_TYPE_COE:
case ETHERCAT_MBOX_TYPE_SOE:
- if ( /*pMBox->Length > 0 &&*/ mbox.Length <= 1500 /*&& pMBox->Length+sizeof(ETHERCAT_MBOX_HEADER_LEN) >= len*/ )
+ if ( /*pMBox->Length > 0 &&*/ mbox.Length <= 1500 /*&& (pMBox->Length+ETHERCAT_MBOX_HEADER_LEN) >= len*/ )
{
bMBox = TRUE;
}