aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iec104.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2021-05-09 11:07:35 -0700
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-05-10 05:38:47 +0000
commit3a62834f46b6802e07b70d7d0f992b195b1fd49a (patch)
treedf73f2f0d12ba985c613f0212297ab9c68647422 /epan/dissectors/packet-iec104.c
parent1701a2db5d4db57a2590b82cd08bc3ffca29f05c (diff)
IEC104: Initialize a variable.
Make sure "tm" is initialized. This should fix *** CID 1484550: Uninitialized variables (UNINIT) /builds/wireshark/wireshark/epan/dissectors/packet-iec104.c: 1120 in get_CP32TimeA() 1114 1115 /* The CP32Time2a structure does not contain any mm/dd/yyyy information. Set these as default to 1/1/2000 */ 1116 tm.tm_mday = 1; 1117 tm.tm_mon = 0; 1118 tm.tm_year = 100; 1119 >>> CID 1484550: Uninitialized variables (UNINIT) >>> Using uninitialized value "tm.tm_isdst" when calling "mktime". 1120 datetime.secs = mktime(&tm); 1121 1122 ti = proto_tree_add_time(tree, hf_iec60870_5_103_cp32time2a, tvb, *offset, 4, &datetime); 1123 cp32time2a_tree = proto_item_add_subtree(ti, ett_iec60870_5_103_cp32time2a); 1124 1125 proto_tree_add_item(cp32time2a_tree, hf_iec60870_5_103_cp32time2a_ms, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
Diffstat (limited to 'epan/dissectors/packet-iec104.c')
-rw-r--r--epan/dissectors/packet-iec104.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index 3e205930df..6be9694dd7 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -1098,7 +1098,7 @@ static void get_CP32TimeA(tvbuff_t *tvb, guint8 *offset, proto_tree *tree)
guint16 ms;
guint8 value;
nstime_t datetime;
- struct tm tm;
+ struct tm tm = {0};
proto_item* ti;
proto_tree* cp32time2a_tree;