From 45189fa8030b8d1df48c9dcfeb49fb119d6b1ab5 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 17 Nov 2010 21:41:30 +0000 Subject: [PATCH] - Fixed bug #53306 (php crashes with segfault when DTrace "exception-thrown" probe fires) patch by: mike at harschsystems dot com --- Zend/zend_exceptions.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index adfef3f3d1b..bcc492d2f3b 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -87,8 +87,13 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */ if (DTRACE_EXCEPTION_THROWN_ENABLED()) { char *classname; int name_len; - zend_get_object_classname(exception, &classname, &name_len); - DTRACE_EXCEPTION_THROWN(classname); + + if (exception != NULL) { + zend_get_object_classname(exception, &classname, &name_len); + DTRACE_EXCEPTION_THROWN(classname); + } else { + DTRACE_EXCEPTION_THROWN(NULL); + } } #endif /* HAVE_DTRACE */