|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: tomc at tripac dot com
New email:
PHP Version: OS:


 [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 18:03:40 2023 UTC