if _der_gmtime() failes (which is can't right now but eventially will) return ASN1_BAD_TIMEFORMAT
This commit is contained in:
@@ -433,7 +433,8 @@ _heim_time2generalizedtime (time_t t, heim_octet_string *s, int gtimep)
|
|||||||
if (s->data == NULL)
|
if (s->data == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
s->length = len;
|
s->length = len;
|
||||||
_der_gmtime(t, &tm);
|
if (_der_gmtime(t, &tm) == NULL)
|
||||||
|
return ASN1_BAD_TIMEFORMAT;
|
||||||
if (gtimep)
|
if (gtimep)
|
||||||
snprintf (s->data, len + 1, "%04d%02d%02d%02d%02d%02dZ",
|
snprintf (s->data, len + 1, "%04d%02d%02d%02d%02d%02dZ",
|
||||||
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
||||||
|
Reference in New Issue
Block a user