com php-src: Fixed Reference handling in xml_parse_into_s truct: ext/json/json.c ext/xml/xml.c

From: Date: Mon, 05 May 2014 11:45:50 +0000
Subject: com php-src: Fixed Reference handling in xml_parse_into_s truct: ext/json/json.c ext/xml/xml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78100@lists.php.net to get a copy of this message
Commit: fa6f6c880741ae9696a9c21707fd3a844dd8d5ee Author: Xinchen Hui <laruence@php.net> Mon, 5 May 2014 19:45:50 +0800 Parents: c73c6526ef4d61881f53f5914398f58a35d1c62f Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fa6f6c880741ae9696a9c21707fd3a844dd8d5ee Log: Fixed Reference handling in xml_parse_into_struct Changed paths: M ext/json/json.c M ext/xml/xml.c Diff: diff --git a/ext/json/json.c b/ext/json/json.c index 528764e..7760741 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -380,7 +380,6 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{ } /* }}} */ - static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC) /* {{{ */ { int pos = 0, ulen = 0; @@ -538,7 +537,6 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR } /* }}} */ - static void json_encode_serializable_object(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(val); @@ -754,7 +752,6 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, } /* }}} */ - /* {{{ proto string json_encode(mixed data [, int options[, int depth]]) Returns the JSON representation of a value */ static PHP_FUNCTION(json_encode) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 146ff00...169be95 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -679,7 +679,7 @@ static void _xml_add_to_info(xml_parser *parser,char *name) return; } - if ((element = zend_hash_str_find(Z_ARRVAL(parser->info),name, strlen(name))) == NULL) { + if ((element = zend_hash_str_find(Z_ARRVAL(parser->info), name, strlen(name))) == NULL) { zval values; array_init(&values); element = zend_hash_str_update(Z_ARRVAL(parser->info), name, strlen(name), &values); @@ -1407,8 +1407,9 @@ PHP_FUNCTION(xml_parse_into_struct) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz|z", &pind, &data, &data_len, &xdata, &info) == FAILURE) { return; } - + if (info) { + ZVAL_DEREF(info); zval_ptr_dtor(info); array_init(info); }

« previous php.cvs (#78100) next »