summaryrefslogtreecommitdiff
path: root/ext/standard/var_unserializer.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-09-26 21:49:16 +0000
committerMarcus Boerger <helly@php.net>2004-09-26 21:49:16 +0000
commit881c2f05f5798056986d1dd28048daa4386ca296 (patch)
tree5a0e7301f16c3f7d645d0594944a1a39b7cb5654 /ext/standard/var_unserializer.c
parentabe47301c1df00e9e28f58f6afcadfdb2bca9d2b (diff)
downloadphp-git-881c2f05f5798056986d1dd28048daa4386ca296.tar.gz
- Earlier detection of failure (.c now)
Diffstat (limited to 'ext/standard/var_unserializer.c')
-rw-r--r--ext/standard/var_unserializer.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 4a21701903..de544cbe90 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Sun Sep 12 14:43:48 2004 */
+/* Generated by re2c 0.9.4 on Mon Sep 13 21:59:57 2004 */
#line 1 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -187,6 +187,12 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
return 0;
}
+ if (Z_TYPE_P(key) != IS_LONG && Z_TYPE_P(key) != IS_STRING) {
+ zval_dtor(key);
+ FREE_ZVAL(key);
+ return 0;
+ }
+
ALLOC_INIT_ZVAL(data);
if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) {
@@ -204,12 +210,6 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
case IS_STRING:
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL);
break;
- default:
- zval_dtor(key);
- FREE_ZVAL(key);
- zval_dtor(data);
- FREE_ZVAL(data);
- return 0;
}
zval_dtor(key);