cvs: /php4/ext/standard var.c
| From: | Thies C. Arntzen | Date: | Wed, 08 Dec 1999 14:41:17 +0000 |
| Subject: | cvs: /php4/ext/standard var.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7672@lists.php.net to get a copy of this message | ||
thies Wed Dec 8 09:41:17 1999 EDT
Modified files:
/php4/ext/standard var.c
Log:
(unserialize) now cleans up better on failure!
Index: php4/ext/standard/var.c
diff -u php4/ext/standard/var.c:1.35 php4/ext/standard/var.c:1.36
--- php4/ext/standard/var.c:1.35 Sat Dec 4 14:16:07 1999
+++ php4/ext/standard/var.c Wed Dec 8 09:40:46 1999
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.35 1999/12/04 19:16:07 sas Exp $ */
+/* $Id: var.c,v 1.36 1999/12/08 14:40:46 thies Exp $ */
/* {{{ includes
@@ -428,7 +428,6 @@
(*p)++;
}
if (**p != ':' || *((*p) + 1) != '{') {
- pval_destructor(*rval);
return 0;
}
for ((*p) += 2; **p && **p != '}' && i > 0; i--) {
@@ -436,13 +435,11 @@
pval *data = emalloc(sizeof(pval));
if (!php_var_unserialize(&key, p, max)) {
- pval_destructor(*rval);
efree(key);
efree(data);
return 0;
}
if (!php_var_unserialize(&data, p, max)) {
- pval_destructor(*rval);
pval_destructor(key);
efree(key);
efree(data);
@@ -503,6 +500,7 @@
}
if (!php_var_unserialize(&return_value, &p, p + (*buf)->value.str.len)) {
+ zval_dtor(return_value);
php_error(E_NOTICE, "unserialize() failed at offset %d of %d
bytes",p-(*buf)->value.str.val,(*buf)->value.str.len);
RETURN_FALSE;
}