php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #858 sprintf gives "Document Contains No Data" when referenced string is empty
Submitted: 1998-10-19 18:48 UTC Modified: 1998-11-20 11:57 UTC
From: leon at clearink dot com Assigned: ssb (profile)
Status: Closed Package: Misbehaving function
PHP Version: 3.0.5 OS: Solaris
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: leon at clearink dot com
New email:
PHP Version: OS:

 

 [1998-10-19 18:48 UTC] leon at clearink dot com
<?
   print(sprintf("%s", ""));
?>

I should note that this is intermittent, though hitting reload a bunch of times seems to cause it to happen reliably.

---

The above code fragment embedded in any script will cause the described behavior.  For example:

<?
   print("XXX\n");
   print(sprintf("%s", ""));
   print("XXX\n");
?>

Sorry I didn't make the clear at first. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-20 11:57 UTC] zeev
1998-11-14 15:45+0100, ssb:

I am unable to reproduce this, but could you try checking
out the latest version of functions/formatted_print.c and
see if the problem persists?

---

First, it should be noted that this example should in fact
result in 'document contains no data' - it prints nothing!

If you can reliably reproduce a crash (i.e., run httpd -X,
hit a page that contains a printf() of an empty string
several times, and get that process to crash - please update
the bug report or submit a new one.  Note that after n times
of hitting the standalone httpd, it'll properly exit (n is
usually 30).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 17:01:36 2024 UTC