mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 13:02:37 +07:00
plugins: check explicitly for (time_t)-1 from mktime()
Found by Coverity Scan. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -183,7 +183,7 @@ static void rtc_restore(void *arg)
|
||||
print_desc(NULL, "Restoring system clock (UTC) from RTC");
|
||||
tm.tm_isdst = -1; /* Use tzdata to figure it out, please. */
|
||||
tv.tv_sec = mktime(&tm);
|
||||
if (tv.tv_sec < rtc_date_fallback) {
|
||||
if (tv.tv_sec == (time_t)-1 || tv.tv_sec < rtc_date_fallback) {
|
||||
errno = EINVAL;
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user