#23162 [Ver->Ana]: user_error() crashs if $error_msg > 1024 bytes
| From: | moriyoshi@php.net | Date: | Fri, 02 May 2003 21:10:21 +0000 |
| Subject: | #23162 [Ver->Ana]: user_error() crashs if $error_msg > 1024 bytes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38955@lists.php.net to get a copy of this message | ||
ID: 23162
Updated by: moriyoshi@php.net
Reported By: dimon at postmark dot net
-Status: Verified
+Status: Analyzed
Bug Type: Scripting Engine problem
Operating System: Windows 2000 Server (only!)
PHP Version: 4.3.2-RC
New Comment:
Segfault could happen on platforms where vsnprintf() is missing.
Previous Comments:
------------------------------------------------------------------------
[2003-05-02 06:30:12] sniper@php.net
Does not crash under Linux.
------------------------------------------------------------------------
[2003-04-14 15:27:20] jay@php.net
I have no idea if this hurts anything (hasn't given me any
trouble), but adding "z_context->is_ref = 1;" to zend.c
before calling call_user_function_ex() in zend_error()
seems to fix the "$context passed by reference" segfault.
Not being much of a ZE engine hacker, I don't know if that
makes things better or worse.
J
------------------------------------------------------------------------
[2003-04-14 03:47:06] dimon at postmark dot net
In Version 4.3.2-RC Apr 14 2003 02:12:05
bug still exists.
------------------------------------------------------------------------
[2003-04-11 19:35:36] magnus@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-04-11 04:17:18] dimon at postmark dot net
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 this bug report at http://bugs.php.net/?id=23162&edit=1