Bug #13251 Updated: [PATCH] Invalid calculation in argument to php_srand
| From: | sniper@php.net | Date: | Sun, 21 Oct 2001 03:05:46 +0000 |
| Subject: | Bug #13251 Updated: [PATCH] Invalid calculation in argument to php_srand | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68536@lists.php.net to get a copy of this message | ||
ID: 13251
Updated by: sniper
Reported By: tomc@tripac.com
Old Status: Open
Status: Closed
Bug Type: Reproducible crash
Operating System: Linux / Cobalt Mips
PHP Version: 4.0.6
New Comment:
Patch committed. Thanks!
Previous Comments:
------------------------------------------------------------------------
[2001-10-02 10:49:02] sniper@php.net
updated summary.
------------------------------------------------------------------------
[2001-09-11 15:01:53] tomc@tripac.com
At line 113 in ext/standard/crypt.c a calculation is made for the argument to php_srand() that
creates an invalid result with gcc 2.7.2 on a Cobalt Mips system. httpd exits with a floating point
exception when PHP is invoked.
Changed
php_srand(time(0) * getpid() * (php_combined_lcg() * 10000.0));
to
php_srand(time(0) * getpid() *
(unsigned long) (php_combined_lcg() * 10000.0));
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13251&edit=1