aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2011-12-23 16:36:59 +0100
committerTobias Brunner <tobias@strongswan.org>2011-12-23 16:38:28 +0100
commitf4095fdc8a22e44d2574d05f6059ed53471dee31 (patch)
tree65fe58d0be63a7219887c8abde42e61e22b9731b /src
parent20d752b4ff582e61a27d0aa8b42222f587665c92 (diff)
downloadstrongswan-f4095fdc8a22e44d2574d05f6059ed53471dee31.tar.bz2
strongswan-f4095fdc8a22e44d2574d05f6059ed53471dee31.tar.xz
Avoid integer overflow when parsing ASN.1 dates.
This only works properly if sizeof(time_t) > 4.
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/asn1/asn1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstrongswan/asn1/asn1.c b/src/libstrongswan/asn1/asn1.c
index e74edde30..6ce818f0d 100644
--- a/src/libstrongswan/asn1/asn1.c
+++ b/src/libstrongswan/asn1/asn1.c
@@ -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)