[tz] Minor (unimportant really) technical UB bug in strftime() ?

Marc Lehmann schmorp at schmorp.de
Tue Nov 8 14:23:18 UTC 2022


On Tue, Nov 08, 2022 at 07:15:39AM -0700, Jonathan Leffler via tz <tz at iana.org> wrote:
> This makes a copy of the `const struct tm` that is the argument to
> strftime(), and passes that copy to mktime(), which reads a few fields and
> sets most fields.  But since it is working on a copy of the argument to
> strftime(), I don't see a problem.  Can you elaborate?

The argument is that some fields might have a trap representation, so
copying the whole struct might not be safe.

-- 
Marc Lehmann


More information about the tz mailing list