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

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC