Bug #13251: Invalid calculation in argument to php_srand
| From: | tomc at tripac dot com | Date: | Tue, 11 Sep 2001 19:01:53 +0000 |
| Subject: | Bug #13251: Invalid calculation in argument to php_srand | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-65792@lists.php.net to get a copy of this message | ||
From: tomc@tripac.com
Operating system: Linux / Cobalt Mips
PHP version: 4.0.6
PHP Bug Type: *Compile Issues
Bug description: Invalid calculation in argument to php_srand
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 bug report at: http://bugs.php.net/?id=13251&edit=1