php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35156 Calling ob_flush after creating an ob callback causes "Segmentation fault"
Submitted: 2005-11-08 16:35 UTC Modified: 2005-11-08 17:21 UTC
From: php at kloopy dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 4.4.1 OS: Win32 and Linux
Private report: No CVE-ID: None
 [2005-11-08 16:35 UTC] php at kloopy dot com
Description:
------------
When setting an output buffer that returns an empty string (I do have a good reason for doing this), later calls to ob_flush() cause PHP to seg fault. 

Tested on PHP-4.1.1 on linux (CLI and Apache2 module) with same error on both.

Also tested on PHP-5.0.5 on Win32 (CLI and Apache2 module) with same error on both.

Reproduce code:
---------------
<?php 
function nooutput($text) { return ""; } 
print "Before\n"; 
ob_start("nooutput"); 
print "Middle\n"; 
ob_flush();
ob_end_flush(); 
print "After\n"; 
?> 


Expected result:
----------------
Before
After

Actual result:
--------------
Before
Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-08 16:50 UTC] tony2001@php.net
Please try using this CVS snapshot:

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


 [2005-11-08 17:13 UTC] php at kloopy dot com
Fixed in latest PHP5 Win32 snapshop.
Also fixed in latest PHP4.4.2 Win32 snapshot.

Thanks.
 [2005-11-08 17:21 UTC] tony2001@php.net
Marking as closed then.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC