[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apr-cvs
Subject:    svn commit: r1872035 - in /apr/apr/branches/1.7.x: CHANGES time/unix/time.c
From:       minfrin () apache ! org
Date:       2019-12-27 20:24:22
Message-ID: 20191227202422.3332C17A010 () svn01-us-east ! apache ! org
[Download RAW message or body]

Author: minfrin
Date: Fri Dec 27 20:24:21 2019
New Revision: 1872035

URL: http://svn.apache.org/viewvc?rev=1872035&view=rev
Log:
Backport r1872034.
Avoid an overflow on 32 bit platforms.

Modified:
    apr/apr/branches/1.7.x/CHANGES
    apr/apr/branches/1.7.x/time/unix/time.c

Modified: apr/apr/branches/1.7.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/CHANGES?rev=1872035&r1=1872034&r2=1872035&view=diff
 ==============================================================================
--- apr/apr/branches/1.7.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.7.x/CHANGES [utf-8] Fri Dec 27 20:24:21 2019
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.7.1
 
+  *) Avoid an overflow on 32 bit platforms. [René Hjortskov Nielsen
+     <r... hjortskov.dk>]
+
   *) Use AC_CHECK_SIZEOF, so as to support cross compiling. PR 56053.
      [Mike Frysinger <vapier gentoo.org>]
 

Modified: apr/apr/branches/1.7.x/time/unix/time.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/time/unix/time.c?rev=1872035&r1=1872034&r2=1872035&view=diff
 ==============================================================================
--- apr/apr/branches/1.7.x/time/unix/time.c (original)
+++ apr/apr/branches/1.7.x/time/unix/time.c Fri Dec 27 20:24:21 2019
@@ -75,7 +75,7 @@ APR_DECLARE(apr_time_t) apr_time_now(voi
 {
     struct timeval tv;
     gettimeofday(&tv, NULL);
-    return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec;
+    return tv.tv_sec * (apr_time_t)APR_USEC_PER_SEC + (apr_time_t)tv.tv_usec;
 }
 
 static void explode_time(apr_time_exp_t *xt, apr_time_t t,


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic