diff options
| author | Remi Collet <remi@php.net> | 2013-05-22 08:29:30 +0200 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2013-05-22 08:29:30 +0200 |
| commit | d64e8dd7a42233efba3c3d5fa5b2f437326f4432 (patch) | |
| tree | 227ac35e0ac1987982219b898609d9bb864dc52e | |
| parent | f5fcb591ccab6f801f727cc9034bceacd7dd034c (diff) | |
| parent | 73eedaf6f74e362a3ff2fdc9cec67148c232d2bf (diff) | |
| download | php-git-d64e8dd7a42233efba3c3d5fa5b2f437326f4432.tar.gz | |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
NEWS
Fixed bug #64895 Integer overflow in SndToJewish
| -rw-r--r-- | ext/calendar/jewish.c | 2 | ||||
| -rw-r--r-- | ext/calendar/tests/jdtojewish64.phpt | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c index 8a78db888f..ddc8aaaf86 100644 --- a/ext/calendar/jewish.c +++ b/ext/calendar/jewish.c @@ -272,7 +272,7 @@ #define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7)) #define JEWISH_SDN_OFFSET 347997 -#define JEWISH_SDN_MAX 38245310 /* year 103759, 100000 A.D. */ +#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */ #define NEW_MOON_OF_CREATION 31524 #define SUNDAY 0 diff --git a/ext/calendar/tests/jdtojewish64.phpt b/ext/calendar/tests/jdtojewish64.phpt index 50f7f33c7b..9f01109a71 100644 --- a/ext/calendar/tests/jdtojewish64.phpt +++ b/ext/calendar/tests/jdtojewish64.phpt @@ -1,5 +1,5 @@ --TEST-- -Integer overflow in SndToJewish leads to php hang +Bug #64895: Integer overflow in SndToJewish --SKIPIF-- <?php include 'skipif.inc'; @@ -9,10 +9,11 @@ if (PHP_INT_SIZE == 4) { ?> --FILE-- <?php -$a = array(38245310, 38245311, 9223372036854743639); +$a = array(38245310, 324542846, 324542847, 9223372036854743639); foreach ($a as $x) var_dump(jdtojewish($x)); --EXPECTF-- string(11) "2/22/103759" +string(12) "12/13/887605" string(5) "0/0/0" string(5) "0/0/0" |
