forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integer overflow in SndToJewish leads to php hang
AT least in (inputDay is long, metonicCycle is int): metonicCycle = (inputDay + 310) / 6940; So large value give strange (negative) results or php hangs. This is patch already applied in some linux distro.
- Loading branch information
1 parent
46b05bc
commit 4828f73
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Integer overflow in SndToJewish leads to php hang | ||
--SKIPIF-- | ||
<?php | ||
include 'skipif.inc'; | ||
if (PHP_INT_SIZE == 4) { | ||
die("skip this test is for 64bit platform only"); | ||
} | ||
?> | ||
--FILE-- | ||
<?php | ||
$a = array(38245310, 38245311, 9223372036854743639); | ||
|
||
foreach ($a as $x) var_dump(jdtojewish($x)); | ||
--EXPECTF-- | ||
string(11) "2/22/103759" | ||
string(5) "0/0/0" | ||
string(5) "0/0/0" |