mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
getdate+nts+rtc: avoid some coverity false positives
Modify the code to avoid making the following calls incorrectly reported as important findings by the coverity static analyzer: - memset() of size 0 at the end of an array - mktime() on a struct tm that has uninitialized tm_yday
This commit is contained in:
@@ -359,13 +359,13 @@ t_from_rtc(struct rtc_time *rtc_raw, int utc)
|
||||
time_t t1, t2;
|
||||
|
||||
/* Convert to seconds since 1970 */
|
||||
memset(&rtc_tm, 0, sizeof (rtc_tm));
|
||||
rtc_tm.tm_sec = rtc_raw->tm_sec;
|
||||
rtc_tm.tm_min = rtc_raw->tm_min;
|
||||
rtc_tm.tm_hour = rtc_raw->tm_hour;
|
||||
rtc_tm.tm_mday = rtc_raw->tm_mday;
|
||||
rtc_tm.tm_mon = rtc_raw->tm_mon;
|
||||
rtc_tm.tm_year = rtc_raw->tm_year;
|
||||
rtc_tm.tm_wday = 0;
|
||||
|
||||
temp1 = rtc_tm;
|
||||
temp1.tm_isdst = 0;
|
||||
|
||||
Reference in New Issue
Block a user