From b507bdb54fdcd98aba436cf9a4a14759dea57560 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sat, 23 Apr 2011 19:42:02 -0700 Subject: [PATCH] if _der_gmtime() failes (which is can't right now but eventially will) return ASN1_BAD_TIMEFORMAT --- lib/asn1/der_put.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/asn1/der_put.c b/lib/asn1/der_put.c index b8101458a..0b276d1eb 100644 --- a/lib/asn1/der_put.c +++ b/lib/asn1/der_put.c @@ -433,7 +433,8 @@ _heim_time2generalizedtime (time_t t, heim_octet_string *s, int gtimep) if (s->data == NULL) return ENOMEM; s->length = len; - _der_gmtime(t, &tm); + if (_der_gmtime(t, &tm) == NULL) + return ASN1_BAD_TIMEFORMAT; if (gtimep) snprintf (s->data, len + 1, "%04d%02d%02d%02d%02d%02dZ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,