Re:PHP 5.3.3 hangs on numeric value 2.2250738585072011e-308
by trezor on Tuesday January 04, 2011 @03:41AM
(#2066339)
So basically you can hang (almost) any website written in PHP which expose primary keys as GET parameters?
Does this just crash the local process for that request or will it also cause problems for other requests? Anyone able to test this?
Re:PHP 5.3.3 hangs on numeric value 2.2250738585072011e-308
by philfreo on Tuesday January 04, 2011 @10:42AM
(#2067300)
Only if it wasn't cast as an integer.
I usually do something like:
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
It has to be treated as a float to be a problem, not as an int.
Re:PHP 5.3.3 hangs on numeric value 2.2250738585072011e-308
by texeltexel on Tuesday January 04, 2011 @03:53AM
(#2066361)
Only if that parameter is treated as number and not as string. And only if the php version/configuration have that bug. It seems to be a problem when converting from decimal string to number.
In Windows it leaves a zombie resource putting the cpu to 100%, so it doesn't seems to be a nice thing...
Re:PHP 5.3.3 hangs on numeric value 2.2250738585072011e-308
by dangrossman on Tuesday January 04, 2011 @12:02PM
(#2067600)
It's going to be a very, very small subset of websites running PHP that could be hung...
- Must be one of the PHP 5.3.3 versions with the bug, where very very few web hosts are running such a recent version (5.0, 5.1 and 5.2 branches are much more common)
- Must be a 32-bit version, no bug in 64-bit
- The PHP program must try to use the input as a number
Apache2 (mod_php) spun at 100% cpu usage.
This suggested workaround works for me. Obviously, it's a limited bandaid, but thanks for suggesting it.