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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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.

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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 09:01:27 2025 UTC