helly Wed Mar 9 20:54:26 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/standard var_unserializer.re
Log:
- MFH
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.27.2.11&r2=1.27.2.12&ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.27.2.11
php-src/ext/standard/var_unserializer.re:1.27.2.12
--- php-src/ext/standard/var_unserializer.re:1.27.2.11 Mon Feb 28 11:33:09 2005
+++ php-src/ext/standard/var_unserializer.re Wed Mar 9 20:54:24 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var_unserializer.re,v 1.27.2.11 2005/02/28 16:33:09 sesser Exp $ */
+/* $Id: var_unserializer.re,v 1.27.2.12 2005/03/10 01:54:24 helly Exp $ */
#include "php.h"
#include "ext/standard/php_var.h"
@@ -27,7 +27,7 @@
typedef struct {
zval *data[VAR_ENTRIES_MAX];
- int used_slots;
+ long used_slots;
void *next;
} var_entries;
@@ -80,7 +80,7 @@
PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval
**nzval)
{
- int i;
+ long i;
var_entries *var_hash = var_hashx->first;
while (var_hash) {
@@ -94,7 +94,7 @@
}
}
-static int var_access(php_unserialize_data_t *var_hashx, int id, zval ***store)
+static int var_access(php_unserialize_data_t *var_hashx, long id, zval
***store)
{
var_entries *var_hash = var_hashx->first;
@@ -115,7 +115,7 @@
PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
{
void *next;
- int i;
+ long i;
var_entries *var_hash = var_hashx->first;
while (var_hash) {
@@ -213,7 +213,7 @@
#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const
unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC
#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC
-static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht,
int elements)
+static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht,
long elements)
{
while (elements-- > 0) {
zval *key, *data, **old_data;
@@ -282,7 +282,7 @@
static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
- int elements;
+ long elements;
elements = parse_iv2((*p) + 2, p);
@@ -292,7 +292,7 @@
return elements;
}
-static inline int object_common2(UNSERIALIZE_PARAMETER, int elements)
+static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
{
zval *retval_ptr = NULL;
zval fname;
@@ -332,7 +332,7 @@
/*!re2c
"R:" iv ";" {
- int id;
+ long id;
*p = YYCURSOR;
if (!var_hash) return 0;
@@ -353,7 +353,7 @@
}
"r:" iv ";" {
- int id;
+ long id;
*p = YYCURSOR;
if (!var_hash) return 0;
@@ -414,7 +414,7 @@
"d:" (iv | nv | nvexp) ";" {
*p = YYCURSOR;
INIT_PZVAL(*rval);
- ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
+ ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
@@ -447,14 +447,18 @@
}
"a:" uiv ":" "{" {
- int elements = parse_iv(start + 2);
-
+ long elements = parse_iv(start + 2);
+ /* use iv() not uiv() in order to check data range */
*p = YYCURSOR;
if (elements < 0) {
return 0;
}
+ if (elements < 0) {
+ return 0;
+ }
+
INIT_PZVAL(*rval);
Z_TYPE_PP(rval) = IS_ARRAY;
ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
@@ -478,7 +482,7 @@
"O:" uiv ":" ["] {
size_t len, len2, len3, maxlen;
- int elements;
+ long elements;
char *class_name;
zend_class_entry *ce;
zend_class_entry **pce;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php