]> granicus.if.org Git - php/commitdiff
Fixed Reference handling in xml_parse_into_struct
authorXinchen Hui <laruence@php.net>
Mon, 5 May 2014 11:45:50 +0000 (19:45 +0800)
committerXinchen Hui <laruence@php.net>
Mon, 5 May 2014 11:45:50 +0000 (19:45 +0800)
ext/json/json.c
ext/xml/xml.c

index 528764e17cee56b5840e7886188bd2af1811b377..77607411251293cbe10f3ba7358e14a6ceafb454 100644 (file)
@@ -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)
index 146ff004f7ad866a4fbc0ec33acd39abbb6a9d9e..169be95981a2aa3558eda6b36f5aa2d1e0c46221 100644 (file)
@@ -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);
        }