From 4b3e77a6f8714a1ac522dd2b902e052c223ada7b Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Wed, 14 Feb 2018 18:35:29 -0500 Subject: [PATCH] Ticket 49568 - Fix integer overflow on 32bit platforms Bug Description: When generating the nsState information for the uniqueid generator the timestamp was overflowing on arm(and possibly other 32 bit platforms). This then broke the upgrade setup code when 50fixNsState.pl was ran. Fix Description: Cast the current time (time_t) to the proper type when when calculating the time since epoch. https://pagure.io/389-ds-base/issue/49568 Reviewed by: ? --- ldap/servers/slapd/uuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c index df86f06c0..a8bd6ee6c 100644 --- a/ldap/servers/slapd/uuid.c +++ b/ldap/servers/slapd/uuid.c @@ -872,7 +872,7 @@ get_system_time(uuid_time_t *uuid_time) /* Offset between UUID formatted times and time() formatted times. UUID UTC base time is October 15, 1582. time() base time is January 1, 1970.*/ - *uuid_time = cur_time * SEQ_PER_SEC + I64(0x01B21DD213814000); + *uuid_time = (uuid_time_t)cur_time * SEQ_PER_SEC + I64(0x01B21DD213814000); } /* ONREPL */ -- 2.13.6