diff options
author | Graham Leggett <minfrin@apache.org> | 2019-12-27 20:24:21 +0000 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2019-12-27 20:24:21 +0000 |
commit | 44e366cd73a09b955d14650505db5d94249b3275 (patch) | |
tree | cc1e48527305104b834d9a81bc23be5e274dcdb4 | |
parent | ce138220283f20c79b582df4134d820335530663 (diff) | |
download | apr-44e366cd73a09b955d14650505db5d94249b3275.tar.gz |
Backport r1872034.
Avoid an overflow on 32 bit platforms.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1872035 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | time/unix/time.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -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>] diff --git a/time/unix/time.c b/time/unix/time.c index dfa45e690..f273beb55 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -75,7 +75,7 @@ APR_DECLARE(apr_time_t) apr_time_now(void) { 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, |