HomeFreeBSD

date: avoid crash on invalid time

Description

date: avoid crash on invalid time

localtime(3) returns NULL when passed an invalid time_t but date(1)
previously did not handle it. Exit with an error in that case.

PR: 220828
Reported by: Vinícius Zavam
Reviewed by: cem, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11660

Details

Provenance
emasteAuthored on
Reviewer
cem
Differential Revision
D11660: date: avoid crash on invalid time
Parents
rS321292: Deal with listening socket correctly.
Branches
Unknown
Tags
Unknown