Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80845 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28447 invoked from network); 19 Jan 2015 19:16:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2015 19:16:11 -0000 Authentication-Results: pb1.pair.com header.from=git@internot.info; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=git@internot.info; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain internot.info designates 185.57.82.47 as permitted sender) X-PHP-List-Original-Sender: git@internot.info X-Host-Fingerprint: 185.57.82.47 mail.internot.info Received: from [185.57.82.47] ([185.57.82.47:36040] helo=mail.internot.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/FF-64889-AF75DB45 for ; Mon, 19 Jan 2015 14:16:10 -0500 To: internals@lists.php.net Cc: Joshua Rogers Date: Tue, 20 Jan 2015 06:15:58 +1100 Message-ID: <1421694958-14772-1-git-send-email-git@internot.info> Subject: [PATCH] Fix potential int overflow in date extension. From: git@internot.info (Joshua Rogers) --- ext/date/lib/tm2unixtime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index c058672..94e5254 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -334,9 +334,9 @@ static timelib_sll do_years(timelib_sll year) static timelib_sll do_months(timelib_ull month, timelib_ull year) { if (timelib_is_leap(year)) { - return ((month_tab_leap[month - 1] + 1) * SECS_PER_DAY); + return (((timelib_ull)month_tab_leap[month - 1] + 1) * SECS_PER_DAY); } else { - return ((month_tab[month - 1]) * SECS_PER_DAY); + return (((timelib_ull)month_tab[month - 1]) * SECS_PER_DAY); } } @@ -361,7 +361,7 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi) case TIMELIB_ZONETYPE_OFFSET: tz->is_localtime = 1; - return tz->z * 60; + return (timelib_sll)tz->z * 60; break; case TIMELIB_ZONETYPE_ABBR: { -- 1.9.1