From 5675140c9e02271551e0a87387c96b89ba2bed32 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 6 Nov 2012 11:16:51 +0700 Subject: [PATCH] Handle NULL filename --- ext/twig/twig.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/ext/twig/twig.c b/ext/twig/twig.c index a4830dc..c070662 100644 --- a/ext/twig/twig.c +++ b/ext/twig/twig.c @@ -604,7 +604,9 @@ static void TWIG_RUNTIME_ERROR(char *filename TSRMLS_DC, char *message, ...) zend_update_property_string(zend_exception_get_default(TSRMLS_C), ex, "message", sizeof("message")-1, buffer TSRMLS_CC); efree(buffer); - zend_update_property_string(*pce, ex, "filename", sizeof("filename")-1, filename TSRMLS_CC); + if (filename) { + zend_update_property_string(*pce, ex, "filename", sizeof("filename")-1, filename TSRMLS_CC); + } zend_throw_exception_object(ex TSRMLS_CC); } -- 1.7.2.5