Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/heimdal/lib/hx509 handle ctime returning NULL.



details:   https://anonhg.NetBSD.org/src/rev/3d05b2b5553b
branches:  trunk
changeset: 753575:3d05b2b5553b
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Apr 02 15:26:17 2010 +0000

description:
handle ctime returning NULL.

diffstat:

 crypto/dist/heimdal/lib/hx509/revoke.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r fa7b85f34f49 -r 3d05b2b5553b crypto/dist/heimdal/lib/hx509/revoke.c
--- a/crypto/dist/heimdal/lib/hx509/revoke.c    Fri Apr 02 15:25:51 2010 +0000
+++ b/crypto/dist/heimdal/lib/hx509/revoke.c    Fri Apr 02 15:26:17 2010 +0000
@@ -51,7 +51,7 @@
 
 #include "hx_locl.h"
 __RCSID("$Heimdal: revoke.c 22275 2007-12-11 11:02:11Z lha $"
-        "$NetBSD: revoke.c,v 1.1 2008/03/22 09:42:41 mlelstv Exp $");
+        "$NetBSD: revoke.c,v 1.2 2010/04/02 15:26:17 christos Exp $");
 
 struct revoke_crl {
     char *path;
@@ -1049,8 +1049,13 @@
 printable_time(time_t t)
 {
     static char s[128];
-    strlcpy(s, ctime(&t)+ 4, sizeof(s));
-    s[20] = 0;
+    char *p;
+    if ((p = ctime(&t)) == NULL)
+       strlcpy(s, "?", sizeof(s));
+    else {
+       strlcpy(s, p + 4, sizeof(s));
+       s[20] = 0;
+    }
     return s;
 }
 



Home | Main Index | Thread Index | Old Index