php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49597 sprintf('%s',join('',array(false))); crashes
Submitted: 2009-09-19 02:36 UTC Modified: 2009-09-27 01:00 UTC
From: markgdesign at gmail dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.2.11 OS: Windows Vista Home
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-09-19 02:36 UTC] markgdesign at gmail dot com
Description:
------------
An array with a false or null element, joined, then used in sprintf 
apparently causes PHP to crash. Actually, Apache cycles endlessly making 
the OS think it has crashed.

This is the simplest expression I can create which causes the problem:
sprintf('%s',join('',array(false)));

Forcing the result of join into type string avoids the problem:
sprintf('%s',(string) join('',array(false)));

Reproduce code:
---------------
sprintf('%s',join('',array(false)));

Expected result:
----------------
I expected it to join all array elements (interpreting false and null 
values as empty strings) and pass it to sprintf.

Actual result:
--------------
Apache cycled without responding to the page request. The Windows OS 
interpreted this as a crash, although Apache did not actually stop 
working or need to be restarted.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-19 14:38 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I can not reproduce this.
 [2009-09-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 10:01:32 2024 UTC