|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
37 + 22 = ?
Subscribe to this entry?

 [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.


php_srand(time(0) * getpid() * (php_combined_lcg() * 10000.0)); 


php_srand(time(0) * getpid() *
    (unsigned long) (php_combined_lcg() * 10000.0)); 


Add a Patch

Pull Requests

Add a Pull Request


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

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 20 20:03:44 2023 UTC