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);
This commit is contained in:
Gerald Combs 2021-05-09 11:07:35 -07:00 committed by Wireshark GitLab Utility
parent 1701a2db5d
commit 3a62834f46
1 changed files with 1 additions and 1 deletions

View File

@ -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;