Fix segfault when time is unreadable

Adding myself to contributors

Closes #130
This commit is contained in:
ed@s5h.net
2020-03-07 16:49:17 +00:00
committed by ed
parent b2753b146a
commit c667083c81
2 changed files with 5 additions and 0 deletions

View File

@@ -163,6 +163,10 @@ static void print_one (/*@null@*/const struct passwd *pw, bool force)
}
tm = localtime (&fl.fail_time);
if (!tm) {
fprintf (stderr, "Cannot read time from faillog.\n");
exit (EXIT_FAILURE);
}
#ifdef HAVE_STRFTIME
strftime (ptime, sizeof (ptime), "%D %H:%M:%S %z", tm);
cp = ptime;