diff options
Diffstat (limited to 'ext/standard/var_unserializer.re')
-rw-r--r-- | ext/standard/var_unserializer.re | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 50d5949a2e..49be916434 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -128,7 +128,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval *nz #if VAR_ENTRIES_DBG fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif - + while (var_hash) { for (i = 0; i < var_hash->used_slots; i++) { if (var_hash->data[i] == ozval) { @@ -146,7 +146,7 @@ static zval *var_access(php_unserialize_data_t *var_hashx, zend_long id) #if VAR_ENTRIES_DBG fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id); #endif - + while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { var_hash = var_hash->next; id -= VAR_ENTRIES_MAX; @@ -168,7 +168,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) #if VAR_ENTRIES_DBG fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L); #endif - + while (var_hash) { next = var_hash->next; efree(var_hash); @@ -281,7 +281,7 @@ static inline zend_long parse_iv2(const unsigned char *p, const unsigned char ** case '+': p++; } - + while (1) { cursor = (char)*p; if (cursor >= '0' && cursor <= '9') { @@ -310,7 +310,7 @@ static inline size_t parse_uiv(const unsigned char *p) if (*p == '+') { p++; } - + while (1) { cursor = *p; if (cursor >= '0' && cursor <= '9') { @@ -355,7 +355,7 @@ numeric_key: } } else if (Z_TYPE(key) == IS_STRING) { if (UNEXPECTED(ZEND_HANDLE_NUMERIC(Z_STR(key), idx))) { - goto numeric_key; + goto numeric_key; } if (UNEXPECTED((old_data = zend_hash_find(ht, Z_STR(key))) != NULL)) { //??? update hash @@ -389,7 +389,7 @@ string_key: return 0; } } - + zval_dtor(&key); if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) { @@ -444,11 +444,11 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) static inline zend_long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) { zend_long elements; - + elements = parse_iv2((*p) + 2, p); (*p) += 2; - + if (ce->serialize == NULL) { object_init_ex(rval, ce); } else { @@ -514,11 +514,11 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) limit = max; cursor = *p; - + if (YYCURSOR >= YYLIMIT) { return 0; } - + if (var_hash && (*p)[0] != 'R') { var_push(var_hash, rval); } @@ -545,7 +545,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) ZVAL_NEW_REF(rval_ref, rval_ref); ZVAL_COPY(rval, rval_ref); } - + return 1; } @@ -568,7 +568,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) //??? } ZVAL_COPY(rval, rval_ref); //??? Z_UNSET_ISREF_PP(rval); - + return 1; } @@ -714,7 +714,7 @@ use_double: "o:" iv ":" ["] { //??? INIT_PZVAL(rval); - + return object_common2(UNSERIALIZE_PASSTHRU, object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); } @@ -736,7 +736,7 @@ object ":" uiv ":" ["] { if (*start == 'C') { custom_object = 1; } - + //??? INIT_PZVAL(rval); len2 = len = parse_uiv(start + 2); maxlen = max - YYCURSOR; @@ -791,17 +791,17 @@ object ":" uiv ":" ["] { zend_string_release(class_name); return 0; } - + /* Check for unserialize callback */ if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { incomplete_class = 1; ce = PHP_IC_ENTRY; break; } - + /* Call unserialize callback */ ZVAL_STRING(&user_func, PG(unserialize_callback_func)); - + ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) { @@ -827,7 +827,7 @@ object ":" uiv ":" ["] { zval_ptr_dtor(&args[0]); return 0; } - + /* The callback function may have defined the class */ if ((ce = zend_lookup_class(class_name)) == NULL) { php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); @@ -853,7 +853,7 @@ object ":" uiv ":" ["] { zend_string_release(class_name); return ret; } - + elements = object_common1(UNSERIALIZE_PASSTHRU, ce); if (incomplete_class) { |