Skip to content

Commit 2d865df

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: news entry for calendar overflow fix Fix integer overflow in calender.
2 parents d1910f6 + d2b0311 commit 2d865df

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ PHP NEWS
55

66
10 Nov 2016, PHP 7.1.0RC6
77

8+
- Calendar:
9+
. Fix integer overflows (Joshua Rogers)
10+
811
- Core:
912
. Fixded bug #72736 (Slow performance when fetching large dataset with mysqli
1013
/ PDO). (Dmitry)

ext/calendar/calendar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
| obtain it through the world-wide-web, please send a note to |
1313
| license@php.net so we can mail you a copy immediately. |
1414
+----------------------------------------------------------------------+
15-
| Authors: Shane Caraveo <shane@caraveo.com> |
15+
| Authors: Shane Caraveo <shane@caraveo.com> |
1616
| Colin Viebrock <colin@easydns.com> |
1717
| Hartmut Holzgraefe <hholzgra@php.net> |
1818
| Wez Furlong <wez@thebrainroom.com> |

ext/calendar/gregor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ zend_long GregorianToSdn(
195195
int inputMonth,
196196
int inputDay)
197197
{
198-
int year;
198+
zend_long year;
199199
int month;
200200

201201
/* check for invalid dates */

ext/calendar/julian.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ zend_long JulianToSdn(
217217
int inputMonth,
218218
int inputDay)
219219
{
220-
int year;
220+
zend_long year;
221221
int month;
222222

223223
/* check for invalid dates */
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
gregoriantojd()
3+
--SKIPIF--
4+
<?php include 'skipif.inc'; ?>
5+
--FILE--
6+
<?php
7+
echo gregoriantojd(5, 5, 6000000) . "\n";
8+
?>
9+
--EXPECT--
10+
2193176185
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
juliantojd()
3+
--SKIPIF--
4+
<?php include 'skipif.inc'; ?>
5+
--FILE--
6+
<?php
7+
echo juliantojd(5, 5, 6000000000) . "\n";
8+
?>
9+
--EXPECT--
10+
622764916319

0 commit comments

Comments
 (0)