helly Wed Mar 9 21:01:40 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard var_unserializer.c Log: - MFH
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.18.4.22&r2=1.18.4.23&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.18.4.22 php-src/ext/standard/var_unserializer.c:1.18.4.23 --- php-src/ext/standard/var_unserializer.c:1.18.4.22 Tue Mar 1 16:56:40 2005 +++ php-src/ext/standard/var_unserializer.c Wed Mar 9 21:01:40 2005 @@ -1,5 +1,5 @@ -/* Generated by re2c 0.9.4 on Tue Mar 1 23:56:03 2005 */ -#line 1 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +/* Generated by re2c 0.9.4 on Thu Mar 10 02:59:20 2005 */ +#line 1 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ | PHP Version 4 | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.c,v 1.18.4.22 2005/03/01 21:56:40 sniper Exp $ */ +/* $Id: var_unserializer.c,v 1.18.4.23 2005/03/10 02:01:40 helly Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -29,7 +29,7 @@ typedef struct { zval *data[VAR_ENTRIES_MAX]; - int used_slots; + long used_slots; void *next; } var_entries; @@ -82,7 +82,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) { @@ -96,7 +96,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; @@ -117,7 +117,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) { @@ -147,7 +147,7 @@ #define YYMARKER marker -#line 154 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 154 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" @@ -210,7 +210,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; @@ -279,7 +279,7 @@ static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) { - int elements; + long elements; elements = parse_iv2((*p) + 2, p); @@ -289,7 +289,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; @@ -432,7 +432,7 @@ if(yych == ':') goto yy87; goto yy4; yy4: -#line 586 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 590 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { return 0; } #line 102 "<stdout>" yy5: yyaccept = 0; @@ -473,7 +473,7 @@ yy14: ++YYCURSOR; goto yy15; yy15: -#line 580 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 584 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); @@ -502,10 +502,10 @@ yy22: ++YYCURSOR; goto yy23; yy23: -#line 491 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 495 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; - int elements; + long elements; char *class_name; zend_class_entry *ce; int incomplete_class = 0; @@ -620,7 +620,7 @@ yy29: ++YYCURSOR; goto yy30; yy30: -#line 483 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 487 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { INIT_PZVAL(*rval); @@ -652,16 +652,20 @@ yy36: ++YYCURSOR; goto yy37; yy37: -#line 461 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 461 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { - 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)); @@ -674,7 +678,7 @@ return finish_nested_data(UNSERIALIZE_PASSTHRU); } -#line 345 "<stdout>" +#line 349 "<stdout>" yy38: yych = *++YYCURSOR; if(yych == '+') goto yy39; if(yych <= '/') goto yy2; @@ -698,7 +702,7 @@ yy43: ++YYCURSOR; goto yy44; yy44: -#line 433 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 433 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -726,7 +730,7 @@ ZVAL_STRINGL(*rval, str, len, 1); return 1; } -#line 398 "<stdout>" +#line 402 "<stdout>" yy45: yych = *++YYCURSOR; if(yych <= '/'){ if(yych <= ','){ @@ -815,14 +819,14 @@ yy55: ++YYCURSOR; goto yy56; yy56: -#line 426 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 426 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { *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; } -#line 496 "<stdout>" +#line 500 "<stdout>" yy57: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -882,7 +886,7 @@ yy66: ++YYCURSOR; goto yy67; yy67: -#line 411 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 411 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -897,7 +901,7 @@ return 1; } -#line 573 "<stdout>" +#line 577 "<stdout>" yy68: yych = *++YYCURSOR; if(yych == 'N') goto yy65; goto yy2; @@ -926,14 +930,14 @@ yy73: ++YYCURSOR; goto yy74; yy74: -#line 404 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 404 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_LONG(*rval, parse_iv(start + 2)); return 1; } -#line 610 "<stdout>" +#line 614 "<stdout>" yy75: yych = *++YYCURSOR; if(yych <= '/') goto yy2; if(yych >= '2') goto yy2; @@ -944,25 +948,25 @@ yy77: ++YYCURSOR; goto yy78; yy78: -#line 397 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 397 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_BOOL(*rval, parse_iv(start + 2)); return 1; } -#line 628 "<stdout>" +#line 632 "<stdout>" yy79: ++YYCURSOR; goto yy80; yy80: -#line 390 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 390 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_NULL(*rval); return 1; } -#line 639 "<stdout>" +#line 643 "<stdout>" yy81: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -988,9 +992,9 @@ yy85: ++YYCURSOR; goto yy86; yy86: -#line 367 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 367 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { - int id; + long id; *p = YYCURSOR; if (!var_hash) return 0; @@ -1011,7 +1015,7 @@ return 1; } -#line 689 "<stdout>" +#line 693 "<stdout>" yy87: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -1037,9 +1041,9 @@ yy91: ++YYCURSOR; goto yy92; yy92: -#line 346 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 346 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" { - int id; + long id; *p = YYCURSOR; if (!var_hash) return 0; @@ -1058,9 +1062,9 @@ return 1; } -#line 737 "<stdout>" +#line 741 "<stdout>" } -#line 588 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" +#line 592 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" return 0;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php