if _der_gmtime() failes (which is can't right now but eventially will) return ASN1_BAD_TIMEFORMAT

This commit is contained in:
Love Hornquist Astrand
2011-04-23 19:42:02 -07:00
parent c5e6aa34dc
commit b507bdb54f

View File

@@ -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,