|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9297 sprintf ("%f", $foo) crashes with very large $foo.
Submitted: 2001-02-16 10:34 UTC Modified: 2001-06-12 17:15 UTC
From: ben at bpeter dot org Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.4pl1 OS: RH Linux 7.0, i386
Private report: No CVE-ID: None
 [2001-02-16 10:34 UTC] ben at bpeter dot org
[ben@home ben]$ echo '<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\n", $foo) ?>' | php 
X-Powered-By: PHP/4.0.4pl1
Content-type: text/html

Segmentation fault (core dumped)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-30 09:17 UTC]
Can you please try the latest CVS or a snapshot from and let us know if this still happens. I can't reproduce it on redhat 6.2.
 [2001-04-30 09:52 UTC]
Works fine for me (RH7 and latest CVS):

[cmv@sunniva cmv]$ echo '<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%fn", $foo) ?>' | php 
X-Powered-By: PHP/4.0.6-dev
Content-type: text/html

2286484951194899000000000000000000000000000000000000000000000000000000000000000n[cmv@sunniva cmv]
 [2001-05-22 01:04 UTC]
It does something strange for me:

[root@mars lib]# /usr/local/bin/php -q
<? $foo = 2.2864849511949E+190;
settype($foo,"double"); printf("%f\nn", $foo) ?>


This is with 4.0.6-dev (latest CVS (22/05/2001)).

 [2001-06-12 17:15 UTC]
It does not crash with PHP 4.0.6RC3:


PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 10:01:28 2024 UTC