felipe Thu, 12 Nov 2009 00:10:00 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=290567
Log: - Fixed bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault) Bug: http://bugs.php.net/50005 (error getting bug information) Changed paths: U php/php-src/branches/PHP_5_2/NEWS A php/php-src/branches/PHP_5_2/Zend/tests/bug50005.phpt U php/php-src/branches/PHP_5_2/main/main.c U php/php-src/branches/PHP_5_3/NEWS A php/php-src/branches/PHP_5_3/Zend/tests/bug50005.phpt U php/php-src/branches/PHP_5_3/main/main.c A php/php-src/trunk/Zend/tests/bug50005.phpt U php/php-src/trunk/main/main.c Modified: php/php-src/branches/PHP_5_2/NEWS =================================================================== --- php/php-src/branches/PHP_5_2/NEWS 2009-11-11 23:34:58 UTC (rev 290566) +++ php/php-src/branches/PHP_5_2/NEWS 2009-11-12 00:10:00 UTC (rev 290567) @@ -23,6 +23,8 @@ - Fixed bug #50073 (parse_url() incorrect when ? in fragment). (Ilia) - Fixed bug #50006 (Segfault caused by uksort()). (Felipe) +- Fixed bug #50005 (Throwing through Reflection modified Exception object + makes segmentation fault). (Felipe) - Fixed bug #49990 (SNMP3 warning message about security level printed twice). (Jani) - Fixed bug #49985 (pdo_pgsql prepare() re-use previous aborted Added: php/php-src/branches/PHP_5_2/Zend/tests/bug50005.phpt =================================================================== --- php/php-src/branches/PHP_5_2/Zend/tests/bug50005.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/Zend/tests/bug50005.phpt 2009-11-12 00:10:00 UTC (rev 290567) @@ -0,0 +1,19 @@ +--TEST-- +Bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault) +--FILE-- +<?php + +class a extends exception { + public function __construct() { + $this->file = null; + } +} + +throw new a; + +?> +--EXPECTF-- +Fatal error: Uncaught exception 'a' in :%d +Stack trace: +#0 {main} + thrown in Unknown on line %d Property changes on: php/php-src/branches/PHP_5_2/Zend/tests/bug50005.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/branches/PHP_5_2/main/main.c =================================================================== --- php/php-src/branches/PHP_5_2/main/main.c 2009-11-11 23:34:58 UTC (rev 290566) +++ php/php-src/branches/PHP_5_2/main/main.c 2009-11-12 00:10:00 UTC (rev 290567) @@ -834,6 +834,9 @@ if (PG(last_error_file)) { free(PG(last_error_file)); } + if (!error_filename) { + error_filename = "Unknown"; + } PG(last_error_type) = type; PG(last_error_message) = strdup(buffer); PG(last_error_file) = strdup(error_filename); Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2009-11-11 23:34:58 UTC (rev 290566) +++ php/php-src/branches/PHP_5_3/NEWS 2009-11-12 00:10:00 UTC (rev 290567) @@ -26,6 +26,8 @@ (Felipe) - Fixed bug #50073 (parse_url() incorrect when ? in fragment). (Ilia) - Fixed bug #50023 (pdo_mysql doesn't use PHP_MYSQL_UNIX_SOCK_ADDR). (Ilia) +- Fixed bug #50005 (Throwing through Reflection modified Exception object + makes segmentation fault). (Felipe) - Fixed bug #49910 (no support for ././@LongLink for long filenames in phar tar support). (Greg) - Fixed bug #49908 (throwing exception in __autoload crashes when interface Added: php/php-src/branches/PHP_5_3/Zend/tests/bug50005.phpt =================================================================== --- php/php-src/branches/PHP_5_3/Zend/tests/bug50005.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/Zend/tests/bug50005.phpt 2009-11-12 00:10:00 UTC (rev 290567) @@ -0,0 +1,19 @@ +--TEST-- +Bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault) +--FILE-- +<?php + +class a extends exception { + public function __construct() { + $this->file = null; + } +} + +throw new a; + +?> +--EXPECTF-- +Fatal error: Uncaught exception 'a' in :%d +Stack trace: +#0 {main} + thrown in Unknown on line %d Property changes on: php/php-src/branches/PHP_5_3/Zend/tests/bug50005.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/branches/PHP_5_3/main/main.c =================================================================== --- php/php-src/branches/PHP_5_3/main/main.c 2009-11-11 23:34:58 UTC (rev 290566) +++ php/php-src/branches/PHP_5_3/main/main.c 2009-11-12 00:10:00 UTC (rev 290567) @@ -889,6 +889,9 @@ if (PG(last_error_file)) { free(PG(last_error_file)); } + if (!error_filename) { + error_filename = "Unknown"; + } PG(last_error_type) = type; PG(last_error_message) = strdup(buffer); PG(last_error_file) = strdup(error_filename); Added: php/php-src/trunk/Zend/tests/bug50005.phpt =================================================================== --- php/php-src/trunk/Zend/tests/bug50005.phpt (rev 0) +++ php/php-src/trunk/Zend/tests/bug50005.phpt 2009-11-12 00:10:00 UTC (rev 290567) @@ -0,0 +1,19 @@ +--TEST-- +Bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault) +--FILE-- +<?php + +class a extends exception { + public function __construct() { + $this->file = null; + } +} + +throw new a; + +?> +--EXPECTF-- +Fatal error: Uncaught exception 'a' in :%d +Stack trace: +#0 {main} + thrown in Unknown on line %d Property changes on: php/php-src/trunk/Zend/tests/bug50005.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/trunk/main/main.c =================================================================== --- php/php-src/trunk/main/main.c 2009-11-11 23:34:58 UTC (rev 290566) +++ php/php-src/trunk/main/main.c 2009-11-12 00:10:00 UTC (rev 290567) @@ -984,6 +984,9 @@ if (PG(last_error_file)) { free(PG(last_error_file)); } + if (!error_filename) { + error_filename = "Unknown"; + } PG(last_error_type) = type; PG(last_error_message) = strdup(buffer); PG(last_error_file) = strdup(error_filename);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php