]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Don't use uninitialized memory when setting RTC time
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 11 Feb 2011 16:54:45 +0000 (17:54 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 11 Feb 2011 16:56:05 +0000 (17:56 +0100)
rtc_linux.c

index c3a6f08d48bcc91bd1b9e10efdcf6b25e5f48d83..5308fb8266e3633264702f6a8ed81bd7472bd1a9 100644 (file)
@@ -669,6 +669,9 @@ set_rtc(time_t new_rtc_time)
   rtc_raw.tm_mday = rtc_tm.tm_mday;
   rtc_raw.tm_mon = rtc_tm.tm_mon;
   rtc_raw.tm_year = rtc_tm.tm_year;
+  rtc_raw.tm_wday = rtc_tm.tm_wday;
+  rtc_raw.tm_yday = rtc_tm.tm_yday;
+  rtc_raw.tm_isdst = rtc_tm.tm_isdst;
 
   status = ioctl(fd, RTC_SET_TIME, &rtc_raw);
   if (status < 0) {