From d00de60443f8d5571aa261198c546e8b74d9d803 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 18 Oct 2012 10:53:17 +0200 Subject: update to 5.4.8 --- php-5.4.8-libxml.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 php-5.4.8-libxml.patch (limited to 'php-5.4.8-libxml.patch') diff --git a/php-5.4.8-libxml.patch b/php-5.4.8-libxml.patch new file mode 100644 index 0000000..d9e92e9 --- /dev/null +++ b/php-5.4.8-libxml.patch @@ -0,0 +1,50 @@ +From 100bb87f5517484d75191ff4cdbbc1fdf579791d Mon Sep 17 00:00:00 2001 +From: jjacky +Date: Fri, 11 May 2012 22:38:05 +0200 +Subject: [PATCH] CGI/FPM process could crash when using libxml, fixes #61557 + +Since d8bddb9665637d96f20dc4a2ae5668ba376f3b17 some SAPI would only setup/reset +callbacks to libxml once, instead of for each request processed. However, this +also included a callback for structured errors, which should remain per request +(as it can be defined through PHP's libxml_use_internal_errors). + +As a result, after the internal handler was set in a request, processing another +request would result in the handler being triggered while the memory associated +with it (LIBXML(error_list)) had been free-d/reset, leading to the process +segfaulting. + +This reset the handler for structured errors after each request. + +(see #61325 also possibly the same bug) +--- + ext/libxml/libxml.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c +index e42d845..92c1099 100644 +--- a/ext/libxml/libxml.c ++++ b/ext/libxml/libxml.c +@@ -851,7 +851,6 @@ static PHP_MSHUTDOWN_FUNCTION(libxml) + { + if (!_php_libxml_per_request_initialization) { + xmlSetGenericErrorFunc(NULL, NULL); +- xmlSetStructuredErrorFunc(NULL, NULL); + + xmlParserInputBufferCreateFilenameDefault(NULL); + xmlOutputBufferCreateFilenameDefault(NULL); +@@ -867,11 +866,11 @@ static int php_libxml_post_deactivate() + /* reset libxml generic error handling */ + if (_php_libxml_per_request_initialization) { + xmlSetGenericErrorFunc(NULL, NULL); +- xmlSetStructuredErrorFunc(NULL, NULL); + + xmlParserInputBufferCreateFilenameDefault(NULL); + xmlOutputBufferCreateFilenameDefault(NULL); + } ++ xmlSetStructuredErrorFunc(NULL, NULL); + + if (LIBXML(stream_context)) { + /* the steam_context resource will be released by resource list destructor */ +-- +1.7.10.1 + -- cgit