Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81183 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63822 invoked from network); 27 Jan 2015 00:31:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2015 00:31:32 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.52 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.52 mail-qg0-f52.google.com Received: from [209.85.192.52] ([209.85.192.52:35715] helo=mail-qg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/B6-25415-36CD6C45 for ; Mon, 26 Jan 2015 19:31:31 -0500 Received: by mail-qg0-f52.google.com with SMTP id z107so9565319qgd.11 for ; Mon, 26 Jan 2015 16:31:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=lDB0VIkIVzM7HTrDJ/sqyh+x9poEmvQ9XDm2bx5BlB0=; b=qg8ItIDfeysGpBFwcMMpu82CLOuPYn/svNzKiiyyNfrdJofMUWeRYJzqx3yFUYlT7f iNBQdLiwvIjozGMwbq/XQRQ/cP/rHd17AEe3dVhOwbIJNL81Be8/YFCvSSAixxfuuskT 20gmM7dBuB1SkAx/VoWU/TPmMNFfDS5iMOORi4x2qOvAHNHT5GcfDyOJ/xCzPOibKhdM IOd6jlE+73O1ZzJhFmDkEUbytsPjepEPVM0SP/MVJcPKP1UZ48+Bb8DlOfcVZBZnQ1ZB MDAElNyllcaNDivEMep7LA9o+WDChsevmFFsYKkifx1JN9cJ+vI3HNg791pWgfV7IjZM fDiQ== X-Received: by 10.140.21.229 with SMTP id 92mr2447344qgl.33.1422318688917; Mon, 26 Jan 2015 16:31:28 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Mon, 26 Jan 2015 16:30:48 -0800 (PST) In-Reply-To: <1421667291-6763-1-git-send-email-git@internot.info> References: <1421667291-6763-1-git-send-email-git@internot.info> Date: Tue, 27 Jan 2015 09:30:48 +0900 X-Google-Sender-Auth: c08we1-XOHkIrEkPIJyEu0EWXTQ Message-ID: To: Joshua Rogers Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c12f8c35e2cf050d976078 Subject: Re: [PHP-DEV] [PATCH] Fix integer overflow in calender. From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c12f8c35e2cf050d976078 Content-Type: text/plain; charset=UTF-8 Hi Joshua, Did you send PR or bug report for this? We need PR or bug report for a bug fix. Thank you. -- Yasuo Ohgaki yohgaki@ohgaki.net On Mon, Jan 19, 2015 at 8:34 PM, Joshua Rogers wrote: > Fix in overflows in conversation functions for calendar. > Add tests for the overflows. > --- > ext/calendar/calendar.c | 2 +- > ext/calendar/gregor.c | 2 +- > ext/calendar/julian.c | 2 +- > ext/calendar/tests/gregoriantojd_overflow.phpt | 10 ++++++++++ > ext/calendar/tests/juliantojd_overflow.phpt | 10 ++++++++++ > 5 files changed, 23 insertions(+), 3 deletions(-) > create mode 100644 ext/calendar/tests/gregoriantojd_overflow.phpt > create mode 100644 ext/calendar/tests/juliantojd_overflow.phpt > > diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c > index f84335b..6e94047 100644 > --- a/ext/calendar/calendar.c > +++ b/ext/calendar/calendar.c > @@ -12,7 +12,7 @@ > | obtain it through the world-wide-web, please send a note to > | > | license@php.net so we can mail you a copy immediately. > | > > +----------------------------------------------------------------------+ > - | Authors: Shane Caraveo > | > + | Authors: Shane Caraveo > | > | Colin Viebrock > | > | Hartmut Holzgraefe > | > | Wez Furlong > | > diff --git a/ext/calendar/gregor.c b/ext/calendar/gregor.c > index 069fe6e..4c91fa8 100644 > --- a/ext/calendar/gregor.c > +++ b/ext/calendar/gregor.c > @@ -195,7 +195,7 @@ zend_long GregorianToSdn( > int inputMonth, > int inputDay) > { > - int year; > + zend_long year; > int month; > > /* check for invalid dates */ > diff --git a/ext/calendar/julian.c b/ext/calendar/julian.c > index 904727f..6ab0854 100644 > --- a/ext/calendar/julian.c > +++ b/ext/calendar/julian.c > @@ -217,7 +217,7 @@ zend_long JulianToSdn( > int inputMonth, > int inputDay) > { > - int year; > + zend_long year; > int month; > > /* check for invalid dates */ > diff --git a/ext/calendar/tests/gregoriantojd_overflow.phpt > b/ext/calendar/tests/gregoriantojd_overflow.phpt > new file mode 100644 > index 0000000..a189cc8 > --- /dev/null > +++ b/ext/calendar/tests/gregoriantojd_overflow.phpt > @@ -0,0 +1,10 @@ > +--TEST-- > +gregoriantojd() > +--SKIPIF-- > + > +--FILE-- > + +echo gregoriantojd(5, 5, 6000000) . "\n"; > +?> > +--EXPECT-- > +2193176185 > diff --git a/ext/calendar/tests/juliantojd_overflow.phpt > b/ext/calendar/tests/juliantojd_overflow.phpt > new file mode 100644 > index 0000000..f2f5aa1 > --- /dev/null > +++ b/ext/calendar/tests/juliantojd_overflow.phpt > @@ -0,0 +1,10 @@ > +--TEST-- > +juliantojd() > +--SKIPIF-- > + > +--FILE-- > + +echo juliantojd(5, 5, 6000000000) . "\n"; > +?> > +--EXPECT-- > +622764916319 > -- > 1.9.1 > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11c12f8c35e2cf050d976078--