#23162 [NEW]: user_error() crashs if $error_msg > 1024 bytes

From: Date: Fri, 11 Apr 2003 09:17:18 +0000
Subject: #23162 [NEW]: user_error() crashs if $error_msg > 1024 bytes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37557@lists.php.net to get a copy of this message
From:             dimon at postmark dot net
Operating system: Windows 2000 Server
PHP version:      4.3.1
PHP Bug Type:     Reproducible crash
Bug description:  user_error() crashs if $error_msg > 1024 bytes

function qq(&$type, &$details, &$file, &$line, $context){
	echo "$details";
}
set_error_handler('qq');
user_error(str_repeat('q', 1025), E_USER_WARNING);
// will cause endless loop


set_error_handler(create_function('$type, &$details, $file, $line,
$context', 'echo "$details";'));
user_error(str_repeat('q', 1025), E_USER_WARNING);
// will cause crash


// btw $context passed by reference will cause crash also
set_error_handler(create_function('$type, &$details, $file, $line,
&$context', 'echo "$details";'));
user_error(str_repeat('q', 1024), E_USER_WARNING);

-- 
Edit bug report at http://bugs.php.net/?id=23162&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23162&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23162&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23162&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23162&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23162&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23162&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23162&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23162&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23162&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23162&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23162&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23162&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23162&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23162&r=gnused



Thread (12 messages)

« previous php.bugs (#37557) next »