[gcr] egg-asn1x: Fix year 2038 workaround



commit 1b5adabfdf64d6bff9302805c3063364b2405f53
Author: Alban Browaeys <prahal yahoo com>
Date:   Wed Sep 20 23:09:21 2017 +0200

    egg-asn1x: Fix year 2038 workaround
    
    Check tm_year for "2038 - 1900" not plain 2038.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787963

 egg/egg-asn1x.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/egg/egg-asn1x.c b/egg/egg-asn1x.c
index d918abd..9e427ee 100644
--- a/egg/egg-asn1x.c
+++ b/egg/egg-asn1x.c
@@ -2213,7 +2213,7 @@ anode_read_time (GNode *node,
                return anode_failure (node, "invalid time content");
 
        /* In order to work with 32 bit time_t. */
-       if (sizeof (time_t) <= 4 && when->tm_year >= 2038) {
+       if (sizeof (time_t) <= 4 && when->tm_year >= 138) {
                *value = (time_t)2145914603;  /* 2037-12-31 23:23:23 */
 
        /* Convert to seconds since epoch */
@@ -4685,7 +4685,7 @@ egg_asn1x_parse_time_general (const gchar *time, gssize n_time)
                return -1;
 
        /* In order to work with 32 bit time_t. */
-       if (sizeof (time_t) <= 4 && when.tm_year >= 2038) {
+       if (sizeof (time_t) <= 4 && when.tm_year >= 138) {
                value = (time_t)2145914603;  /* 2037-12-31 23:23:23 */
 
        /* Convert to seconds since epoch */
@@ -4716,7 +4716,7 @@ egg_asn1x_parse_time_utc (const gchar *time, gssize n_time)
                return -1;
 
        /* In order to work with 32 bit time_t. */
-       if (sizeof (time_t) <= 4 && when.tm_year >= 2038) {
+       if (sizeof (time_t) <= 4 && when.tm_year >= 138) {
                value = (time_t)2145914603;  /* 2037-12-31 23:23:23 */
 
        /* Convert to seconds since epoch */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]