Re: cvs: php-src /ext/xmlreader php_xmlreader.c /ext/xmlreader/tests 012.phpt 013.phpt

From: Date: Sun, 23 Jul 2006 12:22:15 +0000
Subject: Re: cvs: php-src /ext/xmlreader php_xmlreader.c /ext/xmlreader/tests 012.phpt 013.phpt
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-39466@lists.php.net to get a copy of this message
On 19.07.2006 21:32, Rob Richards wrote:
@@ -607,11 +613,18 @@ zval *id; int name_len = 0, ns_uri_len = 0; xmlreader_object *intern; - char *name, *ns_uri, *retchar = NULL; + xmlChar *retchar = NULL; + char *name, *ns_uri; + UConverter *orig_runtime_conv; + + orig_runtime_conv = ZEND_U_CONVERTER(UG(runtime_encoding_conv)); + UG(runtime_encoding_conv) = UG(utf8_conv); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) { + UG(runtime_encoding_conv) = orig_runtime_conv; return; } + UG(runtime_encoding_conv) = orig_runtime_conv;
First of all, why would you want to do that when Unicode mode is disabled? Second, here is what we've got now: 1) UG(runtime_encoding_conv) is not set; 2) ZEND_U_CONVERTER() returns UG(fallback_encoding_conv); 3) you set UG(runtime_encoding_conv) to UG(fallback_encoding_conv); 4) on shutdown unicode_globals_dtor() destroys UG(fallback_encoding_conv) first; 5) then it tries to destroy UG(runtime_encoding_conv) that points to UG(fallback_encoding_conv), which just has been destroyed; 6) Segfault. The end. -- Wbr, Antony Dovgal

« previous php.cvs (#39466) next »