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
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php