From:             jeroen at derks dot it
Operating system: Linux 2.4.20 Debian 3.0
PHP version:      4.3.3
PHP Bug Type:     Reproducible crash
Bug description:  In error handler, modifying 5th arg (errcontext) may result in seg 
fault

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 bug report at http://bugs.php.net/?id=25922&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25922&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25922&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25922&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25922&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25922&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25922&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25922&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25922&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25922&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25922&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25922&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25922&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25922&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25922&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25922&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25922&r=float

Reply via email to