From: Charles Date: Tue, 6 Nov 2012 04:16:51 +0000 (+0700) Subject: Handle NULL filename X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=5675140c9e02271551e0a87387c96b89ba2bed32;p=web%2Fkonrad%2Ftwig.git Handle NULL filename --- 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); }