From 11ee48ed76cfb9948a5bc5609c0c67b1cc26f938 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Thu, 12 Nov 2009 00:10:00 +0000 Subject: [PATCH] - Fixed bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault) --- Zend/tests/bug50005.phpt | 19 +++++++++++++++++++ main/main.c | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 Zend/tests/bug50005.phpt 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); -- 2.50.1