mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +00: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 parent
9a962c86c8
commit
2e5b97c8b2
1 file changed
+1
-1
+1
-1
@@ -183,7 +183,7 @@ static void rtc_restore(void *arg)
|
|||||||
print_desc(NULL, "Restoring system clock (UTC) from RTC");
|
print_desc(NULL, "Restoring system clock (UTC) from RTC");
|
||||||
tm.tm_isdst = -1; /* Use tzdata to figure it out, please. */
|
tm.tm_isdst = -1; /* Use tzdata to figure it out, please. */
|
||||||
tv.tv_sec = mktime(&tm);
|
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;
|
errno = EINVAL;
|
||||||
goto invalid;
|
goto invalid;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user