aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Ulis <daulis0@gmail.com>2019-01-06 19:31:31 -0500
committerAnders Broman <a.broman58@gmail.com>2019-01-07 04:40:36 +0000
commite313b2535974b34d453f31769293e909a3ffe80f (patch)
tree852547e201a845a7797b360ca6481e4d0d347fdd
parent52747f466ecb5de01f2e67c9566546d9a602d115 (diff)
CIP: Correct DATE_AND_TIME parsing
DATE_AND_TIME struct is actually time then date. We were previously parsing it as date then time. Change-Id: I7367b5502318de32b7c9e7fd170ae58de4c3347f Reviewed-on: https://code.wireshark.org/review/31431 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-cip.c4
-rw-r--r--epan/dissectors/packet-cipsafety.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index 30e56eb06e..8ca0322223 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -5244,8 +5244,8 @@ void dissect_cip_date_and_time(proto_tree *tree, tvbuff_t *tvb, int offset, int
guint16 num_days_since_1972;
guint32 num_ms_today;
- num_days_since_1972 = tvb_get_letohs( tvb, offset);
- num_ms_today = tvb_get_letohl( tvb, offset+2 );
+ num_days_since_1972 = tvb_get_letohs(tvb, offset+4);
+ num_ms_today = tvb_get_letohl(tvb, offset);
if ((num_days_since_1972 != 0) || (num_ms_today != 0))
{
diff --git a/epan/dissectors/packet-cipsafety.c b/epan/dissectors/packet-cipsafety.c
index 26edf197c3..fbfbd38180 100644
--- a/epan/dissectors/packet-cipsafety.c
+++ b/epan/dissectors/packet-cipsafety.c
@@ -472,7 +472,7 @@ void dissect_cipsafety_ssn(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _
{
guint16 date;
- date = tvb_get_letohs( tvb, offset);
+ date = tvb_get_letohs(tvb, offset+4);
if ((date >= 11688) && (date <= 65534))
{
@@ -482,8 +482,8 @@ void dissect_cipsafety_ssn(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _
else
{
/* Treated as UINT16 and UINT32 values */
- proto_tree_add_item(tree, hf_date, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(tree, hf_time, tvb, offset+2, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(tree, hf_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(tree, hf_date, tvb, offset + 4, 2, ENC_LITTLE_ENDIAN);
}
}