summaryrefslogtreecommitdiff
path: root/sys/kern/clock_subr.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-07-02 01:58:43 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-07-02 01:58:43 +0000
commit8bd06823eb49787242588dac0e55150de2b3ccae (patch)
tree5f54acda812faf35285e529f36a379ac1e7f1919 /sys/kern/clock_subr.c
parentf1d93108272959671a778d688d96e156720e5532 (diff)
Cast to time_t before the final multiplication to prevent overflow in
2038. This'll last for another 4083 years or so... ok deraadt@
Diffstat (limited to 'sys/kern/clock_subr.c')
-rw-r--r--sys/kern/clock_subr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/clock_subr.c b/sys/kern/clock_subr.c
index 7cbef619a6c..7e5424e5244 100644
--- a/sys/kern/clock_subr.c
+++ b/sys/kern/clock_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock_subr.c,v 1.2 2006/11/14 18:00:27 jmc Exp $ */
+/* $OpenBSD: clock_subr.c,v 1.3 2013/07/02 01:58:42 guenther Exp $ */
/* $NetBSD: clock_subr.c,v 1.3 1997/03/15 18:11:16 is Exp $ */
/*
@@ -107,7 +107,7 @@ clock_ymdhms_to_secs(struct clock_ymdhms *dt)
days += (dt->dt_day - 1);
/* Add hours, minutes, seconds. */
- secs = ((days
+ secs = (time_t)((days
* 24 + dt->dt_hour)
* 60 + dt->dt_min)
* 60 + dt->dt_sec;