diff options
author | Stef Walter <stefw@gnome.org> | 2013-03-27 17:54:38 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-03-28 13:26:38 +0100 |
commit | 87a0afed5db7e916a6ad6715e14996b2e25641d7 (patch) | |
tree | 3e5b2bdc468e63977adfd184988b5910191893ab /common | |
parent | b0e44f8e1e589726c95506da5121e95a54269fd7 (diff) |
Don't try to guess at overflowing time values on 32-bit systems
Since CKA_START_DATE and CKA_END_DATE are the only places
where we want to parse out times, and these are optional, just
leave blank if the time overflows what libc can handle on
a 32-bit system.
https://bugs.freedesktop.org/show_bug.cgi?id=62825
Diffstat (limited to 'common')
-rw-r--r-- | common/asn1.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/asn1.c b/common/asn1.c index 44f96eb..c98d959 100644 --- a/common/asn1.c +++ b/common/asn1.c @@ -469,9 +469,9 @@ when_and_offset_to_time_t (struct tm *when, { time_t timet; - /* In order to work with 32 bit time_t. */ - if (sizeof (time_t) <= 4 && when->tm_year >= 2038) { - timet = (time_t)2145914603; /* 2037-12-31 23:23:23 */ + /* A 32-bit time, cannot represent this time */ + if (sizeof (time_t) <= 4 && when->tm_year >= 138) { + return -1; /* Convert to seconds since epoch */ } else { |