From 48ec19c9be186e4e0d21dc54a35e723b9f86b39f Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sun, 15 Sep 2002 21:19:02 +0000 Subject: [PATCH] * kerberos_v4.c (check_princ): Call strftime() with correct number of arguments. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14869 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 5 +++++ src/kdc/kerberos_v4.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index 17f2d584d..7fa252f0c 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,8 @@ +2002-09-15 Tom Yu + + * kerberos_v4.c (check_princ): Call strftime() with correct number + of arguments. + 2002-09-15 Ken Raeburn * kerberos_v4.c: Always include stdarg.h, not varargs.h. diff --git a/src/kdc/kerberos_v4.c b/src/kdc/kerberos_v4.c index e24d23340..2856d5fb6 100644 --- a/src/kdc/kerberos_v4.c +++ b/src/kdc/kerberos_v4.c @@ -1085,7 +1085,8 @@ check_princ(char *p_name, char *instance, int lifetime, Principal *p, time_t t = p->exp_date; tm = localtime(&t); - strftime(timestr, "%Y-%m-%d %H:%M:%S", tm); + if (!strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S", tm)) + timestr[0] = '\0'; lt = klog(L_ERR_SEXP, "EXPIRED \"%s\" \"%s\" %s", p->name, p->instance, timestr); return KERB_ERR_NAME_EXP; -- 2.26.2