From: Tom Yu Date: Sun, 15 Sep 2002 21:19:02 +0000 (+0000) Subject: * kerberos_v4.c (check_princ): Call strftime() with correct number X-Git-Tag: krb5-1.3-alpha1~382 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=48ec19c9be186e4e0d21dc54a35e723b9f86b39f;p=krb5.git * 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 --- 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;