diff --git a/NEWS b/NEWS index 798897da5d7..8aeb463c9fb 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ PHP NEWS 10 Nov 2016, PHP 7.1.0RC6 +- Calendar: + . Fix integer overflows (Joshua Rogers) + - Core: . Fixded bug #72736 (Slow performance when fetching large dataset with mysqli / PDO). (Dmitry) diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 76248a6554c..b5d21a4dcde 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 069fe6eb5ae..4c91fa8d540 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 904727ff042..6ab0854c3be 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 00000000000..a189cc80c35 --- /dev/null +++ b/ext/calendar/tests/gregoriantojd_overflow.phpt @@ -0,0 +1,10 @@ +--TEST-- +gregoriantojd() +--SKIPIF-- + +--FILE-- + +--EXPECT-- +2193176185 diff --git a/ext/calendar/tests/juliantojd_overflow.phpt b/ext/calendar/tests/juliantojd_overflow.phpt new file mode 100644 index 00000000000..f2f5aa182d0 --- /dev/null +++ b/ext/calendar/tests/juliantojd_overflow.phpt @@ -0,0 +1,10 @@ +--TEST-- +juliantojd() +--SKIPIF-- + +--FILE-- + +--EXPECT-- +622764916319