php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13251 [PATCH] Invalid calculation in argument to php_srand
Submitted: 2001-09-11 15:01 UTC Modified: 2001-10-20 23:05 UTC
From: tomc at tripac dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.0.6 OS: Linux / Cobalt Mips
Private report: No CVE-ID: None
 [2001-09-11 15:01 UTC] tomc at tripac dot 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)); 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-02 10:49 UTC] sniper@php.net
updated summary. 
 [2001-10-20 23:05 UTC] sniper@php.net
Patch committed. Thanks!

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Mar 28 18:01:24 2020 UTC