]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
date: avoid crash on invalid time
authoremaste <emaste@FreeBSD.org>
Thu, 20 Jul 2017 15:28:48 +0000 (15:28 +0000)
committeremaste <emaste@FreeBSD.org>
Thu, 20 Jul 2017 15:28:48 +0000 (15:28 +0000)
commitd5e1936733c18be53772b1f3a16b1f387cfc0569
tree113f803ecf9c2f1cf4a4a9f4807ae9a8d1c58d82
parent0c018c8ab740a29e2589c6bb2107eb401477fef9
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
bin/date/date.c