#25922 [Opn->Fbk]: In error handler, modifying 5th arg (errcontext) may result in seg fault
| From: | helly@php.net | Date: | Mon, 20 Oct 2003 18:11:56 +0000 |
| Subject: | #25922 [Opn->Fbk]: In error handler, modifying 5th arg (errcontext) may result in seg fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-49247@lists.php.net to get a copy of this message | ||
ID: 25922
Updated by: helly@php.net
Reported By: jeroen at derks dot it
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Linux 2.4.20 Debian 3.0
PHP Version: 4.3.3
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2003-10-20 07:54:21] jeroen at derks dot it
Description:
------------
Modifying 5th parameter of error handler will make PHP crash when
leaving the error handler.
NB: This seems to happen only when the error was generated in a
function (possibly also in a member function). Please see the code.
NB2: When changing function test()'s parameter name into $args, PHP
exitted normally.
Reproduce code:
---------------
function my_error_handler( $error, $errmsg = '', $errfile = '',
$errline = 0, $errcontext = '' )
{
$errcontext = '';
}
set_error_handler( 'my_error_handler' );
function test( $headers = '' )
{
echo "Undefined index here: '{$data['HTTP_HEADER']}'\n";
}
test();
Expected result:
----------------
Undefined index here: ''
Actual result:
--------------
Undefined index here: ''
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25922&edit=1