]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/timeutils.c: bug fix Segmentation fault
authorJ William Piggott <elseifthen@gmx.com>
Sat, 9 Dec 2017 19:01:33 +0000 (14:01 -0500)
committerJ William Piggott <elseifthen@gmx.com>
Sat, 9 Dec 2017 19:01:33 +0000 (14:01 -0500)
commit97772cc329bfa555b38416dc4dcacd4d318560c3
treec6f0c94260bf6d78d3f0233ea7b47f6f9159260e
parent44d753407d6b751f022ef234c85785ccd99c5590
lib/timeutils.c: bug fix Segmentation fault

Use reentrant time functions to avoid sending a NULL pointer to
format_iso_time() (and to be reentrant ;). Followup commits test for
errors and tm_year wrapping (illustrated below).

hwclock --utc --noadjfile --predict --date '67768034678849400 seconds'
Segmentation fault

Patched
hwclock --utc --noadjfile --predict --date '67768034678849400 seconds'
-2147481748-01-00 00:10:46.000000-05:00

Signed-off-by: J William Piggott <elseifthen@gmx.com>
lib/timeutils.c