[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH v2] ntpd: make NTP client and server Y2036/2038-ready
From: Miroslav Lichvar <mlichvar () redhat ! com>
Date: 2022-09-16 13:35:06
Message-ID: YyR7ioFcZIpzLBv4 () localhost
[Download RAW message or body]
On Fri, Sep 16, 2022 at 03:06:36PM +0200, Miroslav Lichvar wrote:
> @@ -554,7 +554,7 @@ gettime1900d(void)
> static void
> d_to_tv(struct timeval *tv, double d)
> {
> - tv->tv_sec = (long)d;
> + tv->tv_sec = (time_t)d;
> tv->tv_usec = (d - tv->tv_sec) * 1000000;
I suspect this part can be undefined behavior if time_t is 32-bit and
the client attempts to step after 2038. Do you want this case to be
handled, maybe with an error message logged?
--
Miroslav Lichvar
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic