rrichards               Mon May 31 07:20:46 2004 EDT

  Modified files:              
    /php-src/ext/libxml libxml.c 
  Log:
  fix leak when using relaxng
  interim fix for isolating our streams handling
  - once libxml supports overriding streams this should be changed
    for security reasons
  
http://cvs.php.net/diff.php/php-src/ext/libxml/libxml.c?r1=1.17&r2=1.18&ty=u
Index: php-src/ext/libxml/libxml.c
diff -u php-src/ext/libxml/libxml.c:1.17 php-src/ext/libxml/libxml.c:1.18
--- php-src/ext/libxml/libxml.c:1.17    Fri Apr 23 13:31:44 2004
+++ php-src/ext/libxml/libxml.c Mon May 31 07:20:46 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: libxml.c,v 1.17 2004/04/23 17:31:44 rrichards Exp $ */
+/* $Id: libxml.c,v 1.18 2004/05/31 11:20:46 rrichards Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -40,6 +40,9 @@
 #include <libxml/tree.h>
 #include <libxml/uri.h>
 #include <libxml/xmlerror.h>
+#ifdef LIBXML_SCHEMAS_ENABLED
+#include <libxml/relaxng.h>
+#endif
 
 #include "php_libxml.h"
 
@@ -241,7 +244,11 @@
 int php_libxml_streams_IO_match_wrapper(const char *filename)
 {
        TSRMLS_FETCH();
-       return php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC) ? 1 : 0;
+
+       if (zend_is_executing(TSRMLS_C)) {
+               return php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC) ? 1 
: 0;
+       }
+       return 0;
 }
 
 void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, 
const int read_only)
@@ -408,6 +415,9 @@
 
 PHP_LIBXML_API void php_libxml_shutdown() {
        if (_php_libxml_initialized) {
+#if defined(LIBXML_SCHEMAS_ENABLED)
+               xmlRelaxNGCleanupTypes();
+#endif
                xmlCleanupParser();
                zend_hash_destroy(&php_libxml_exports);
                _php_libxml_initialized = 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to