Avoid integer overflow when parsing ASN.1 dates.

This only works properly if sizeof(time_t) > 4.
This commit is contained in:
Tobias Brunner
2011-12-23 16:38:28 +01:00
parent 20d752b4ff
commit f4095fdc8a
+2 -2
View File
@@ -326,10 +326,10 @@ static const int tm_leap_1970 = 477;
*/
time_t asn1_to_time(const chunk_t *utctime, asn1_t type)
{
int tm_year, tm_mon, tm_day, tm_days, tm_hour, tm_min, tm_sec;
int tm_year, tm_mon, tm_day, tm_hour, tm_min, tm_sec;
int tm_leap_4, tm_leap_100, tm_leap_400, tm_leap;
int tz_hour, tz_min, tz_offset;
time_t tm_secs;
time_t tm_days, tm_secs;
u_char *eot = NULL;
if ((eot = memchr(utctime->ptr, 'Z', utctime->len)) != NULL)