From: Felipe Pena Date: Thu, 12 Nov 2009 00:10:00 +0000 (+0000) Subject: - Fixed bug #50005 (Throwing through Reflection modified Exception object makes segme... X-Git-Tag: php-5.4.0alpha1~191^2~2406 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11ee48ed76cfb9948a5bc5609c0c67b1cc26f938;p=php - Fixed bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault) --- diff --git a/Zend/tests/bug50005.phpt b/Zend/tests/bug50005.phpt new file mode 100644 index 0000000000..bf4fbbda68 --- /dev/null +++ b/Zend/tests/bug50005.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault) +--FILE-- +file = null; + } +} + +throw new a; + +?> +--EXPECTF-- +Fatal error: Uncaught exception 'a' in :%d +Stack trace: +#0 {main} + thrown in Unknown on line %d diff --git a/main/main.c b/main/main.c index 50f3e82e28..5742829769 100644 --- a/main/main.c +++ b/main/main.c @@ -984,6 +984,9 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ 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);