diff options
author | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
commit | e63a8540a60e95aa5bd8e269add1b02afcc1b79b (patch) | |
tree | b83a144eec24cc81adab0b9a778f7a730d8df79e /ext/xml/xml.c | |
parent | 7a4cc73641bb3eb878f7184bcbd026ee663cf2a9 (diff) | |
parent | 53071e647049f099f7f7a0771ddb63fc2cdd621c (diff) | |
download | php-git-e63a8540a60e95aa5bd8e269add1b02afcc1b79b.tar.gz |
Merge branch 'openssl_error_store' into openssl_aead
Diffstat (limited to 'ext/xml/xml.c')
-rw-r--r-- | ext/xml/xml.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c index b832732f0d..fe29f2891d 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -63,7 +63,7 @@ ZEND_DECLARE_MODULE_GLOBALS(xml) /* {{{ dynamically loadable module stuff */ #ifdef COMPILE_DL_XML #ifdef ZTS -ZEND_TSRMLS_CACHE_DEFINE(); +ZEND_TSRMLS_CACHE_DEFINE() #endif ZEND_GET_MODULE(xml) #endif /* COMPILE_DL_XML */ @@ -483,9 +483,7 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f zend_fcall_info fci; fci.size = sizeof(fci); - fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, handler); - fci.symbol_table = NULL; fci.object = Z_OBJ(parser->object); fci.retval = retval; fci.param_count = argc; @@ -581,7 +579,7 @@ PHP_XML_API zend_string *xml_utf8_encode(const char *s, size_t len, const XML_Ch } /* This is the theoretical max (will never get beyond len * 2 as long * as we are converting from single-byte characters, though) */ - str = zend_string_alloc(len * 4, 0); + str = zend_string_safe_alloc(len, 4, 0, 0); ZSTR_LEN(str) = 0; while (pos > 0) { c = encoder ? encoder((unsigned char)(*s)) : (unsigned short)(*s); @@ -1556,7 +1554,6 @@ PHP_FUNCTION(xml_parser_free) { zval *pind; xml_parser *parser; - zend_resource *res; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) { return; @@ -1571,9 +1568,10 @@ PHP_FUNCTION(xml_parser_free) RETURN_FALSE; } - res = Z_RES(parser->index); - ZVAL_UNDEF(&parser->index); - zend_list_close(res); + if (zend_list_delete(Z_RES(parser->index)) == FAILURE) { + RETURN_FALSE; + } + RETURN_TRUE; } /* }}} */ |