diff options
-rw-r--r-- | modules/pam_faillock/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/pam_faillock/main.c b/modules/pam_faillock/main.c index f62e1bb2..ea6329ca 100644 --- a/modules/pam_faillock/main.c +++ b/modules/pam_faillock/main.c @@ -174,6 +174,11 @@ do_user(struct options *opts, const char *user) time_t when = tallies.records[i].time; tm = localtime(&when); + if(tm == NULL) { + fprintf(stderr, "%s: Invalid timestamp in the tally record\n", + opts->progname); + continue; + } strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm); printf("%-19s %-5s %-52.52s %s\n", timebuf, status & TALLY_STATUS_RHOST ? "RHOST" : (status & TALLY_STATUS_TTY ? "TTY" : "SVC"), |