Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug46882.phpt

2009-03-18 Thread Matt Wilmas

Hi Pierre, Felipe,

- Original Message -
From: Pierre Joye
Sent: Tuesday, March 17, 2009


2009/3/17 Matt Wilmas matt...@php.net:
 mattwil Tue Mar 17 22:02:05 2009 UTC

 Added files:
 /php-src/ext/standard/tests/serialize bug46882.phpt

 Modified files:
 /php-src/ext/standard var_unserializer.c var_unserializer.re
 Log:
 Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with 
 different bit numbers)


 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.97r2=1.98diff_format=u
 Index: php-src/ext/standard/var_unserializer.c
 diff -u php-src/ext/standard/var_unserializer.c:1.97 
 php-src/ext/standard/var_unserializer.c:1.98


 +--+
 - | PHP Version 6 |
 + | PHP Version 5 |


That's 6 not 5 :)


Hmm, I think I realize how I got that screwed up, with copy/paste and not 
paying attention. :-)  I thought everything was updated, and always check a 
diff first, but missed that...


I see Felipe was on it right away though. :-)  Thanks Felipe!


--
Pierre


- Matt 



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug46882.phpt

2009-03-17 Thread Matt Wilmas
mattwil Tue Mar 17 22:02:05 2009 UTC

  Added files: 
/php-src/ext/standard/tests/serialize   bug46882.phpt 

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with 
different bit numbers)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.97r2=1.98diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.97 
php-src/ext/standard/var_unserializer.c:1.98
--- php-src/ext/standard/var_unserializer.c:1.97Tue Mar 10 23:39:41 2009
+++ php-src/ext/standard/var_unserializer.c Tue Mar 17 22:02:05 2009
@@ -1,8 +1,8 @@
-/* Generated by re2c 0.13.5 on Fri Aug 29 18:45:19 2008 */
+/* Generated by re2c 0.13.5 on Tue Mar 17 16:18:00 2009 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
-  | PHP Version 6|
+  | PHP Version 5|
   +--+
   | Copyright (c) 1997-2006 The PHP Group|
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.97 2009/03/10 23:39:41 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.98 2009/03/17 22:02:05 mattwil Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -522,7 +522,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy103;
 yy3:
-#line 794 ext/standard/var_unserializer.re
+#line 817 ext/standard/var_unserializer.re
{ return 0; }
 #line 528 ext/standard/var_unserializer.c
 yy4:
@@ -571,7 +571,7 @@
goto yy3;
 yy15:
++YYCURSOR;
-#line 788 ext/standard/var_unserializer.re
+#line 811 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);
@@ -607,7 +607,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 670 ext/standard/var_unserializer.re
+#line 693 ext/standard/var_unserializer.re
{
size_t len, len2, len3, maxlen;
long elements;
@@ -750,7 +750,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 662 ext/standard/var_unserializer.re
+#line 685 ext/standard/var_unserializer.re
{
 
INIT_PZVAL(*rval);
@@ -779,7 +779,7 @@
yych = *++YYCURSOR;
if (yych != '{') goto yy19;
++YYCURSOR;
-#line 642 ext/standard/var_unserializer.re
+#line 665 ext/standard/var_unserializer.re
{
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -820,7 +820,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 613 ext/standard/var_unserializer.re
+#line 636 ext/standard/var_unserializer.re
{
size_t len, maxlen;
UChar *ustr;
@@ -870,7 +870,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 584 ext/standard/var_unserializer.re
+#line 607 ext/standard/var_unserializer.re
{
size_t len, maxlen;
char *str;
@@ -920,7 +920,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 556 ext/standard/var_unserializer.re
+#line 579 ext/standard/var_unserializer.re
{
size_t len, maxlen;
char *str;
@@ -1036,14 +1036,17 @@
}
 yy71:
++YYCURSOR;
-#line 549 ext/standard/var_unserializer.re
+#line 569 ext/standard/var_unserializer.re
{
+#if SIZEOF_LONG == 4
+use_double:
+#endif
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
 }
-#line 1047 ext/standard/var_unserializer.c
+#line 1050 ext/standard/var_unserializer.c
 yy73:
yych = *++YYCURSOR;
if (yych = ',') {
@@ -1102,7 +1105,7 @@
yych = *++YYCURSOR;
if (yych != ';') goto yy19;
++YYCURSOR;
-#line 534 ext/standard/var_unserializer.re
+#line 554 ext/standard/var_unserializer.re
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1117,7 +1120,7 @@
 
return 1;
 }
-#line 1121 ext/standard/var_unserializer.c
+#line 1124 ext/standard/var_unserializer.c
 yy84:
yych = *++YYCURSOR;
if (yych == 'N') goto yy81;
@@ -1146,12 +1149,32 @@
++YYCURSOR;
 #line 527 ext/standard/var_unserializer.re
{
+#if SIZEOF_LONG == 4
+   int digits = YYCURSOR - start - 3;
+
+   if (start[2] == '-' || start[2] == '+') {
+   

Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug46882.phpt

2009-03-17 Thread Pierre Joye
2009/3/17 Matt Wilmas matt...@php.net:
 mattwil         Tue Mar 17 22:02:05 2009 UTC

  Added files:
    /php-src/ext/standard/tests/serialize       bug46882.phpt

  Modified files:
    /php-src/ext/standard       var_unserializer.c var_unserializer.re
  Log:
  Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with 
 different bit numbers)

 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.97r2=1.98diff_format=u
 Index: php-src/ext/standard/var_unserializer.c
 diff -u php-src/ext/standard/var_unserializer.c:1.97 
 php-src/ext/standard/var_unserializer.c:1.98

   +--+
 -  | PHP Version 6                                                        |
 +  | PHP Version 5                                                        |


That's 6 not 5 :)

-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2009-03-17 Thread Felipe Pena
felipe  Tue Mar 17 23:02:22 2009 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  - Fix version  year++
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.98r2=1.99diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.98 
php-src/ext/standard/var_unserializer.c:1.99
--- php-src/ext/standard/var_unserializer.c:1.98Tue Mar 17 22:02:05 2009
+++ php-src/ext/standard/var_unserializer.c Tue Mar 17 23:02:22 2009
@@ -2,9 +2,9 @@
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
-  | PHP Version 5|
+  | PHP Version 6|
   +--+
-  | Copyright (c) 1997-2006 The PHP Group|
+  | Copyright (c) 1997-2009 The PHP Group|
   +--+
   | This source file is subject to version 3.01 of the PHP license,  |
   | that is bundled with this package in the file LICENSE, and is|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.98 2009/03/17 22:02:05 mattwil Exp $ */
+/* $Id: var_unserializer.c,v 1.99 2009/03/17 23:02:22 felipe Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.76r2=1.77diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.76 
php-src/ext/standard/var_unserializer.re:1.77
--- php-src/ext/standard/var_unserializer.re:1.76   Tue Mar 17 22:02:05 2009
+++ php-src/ext/standard/var_unserializer.reTue Mar 17 23:02:22 2009
@@ -1,8 +1,8 @@
 /*
   +--+
-  | PHP Version 5|
+  | PHP Version 6|
   +--+
-  | Copyright (c) 1997-2006 The PHP Group|
+  | Copyright (c) 1997-2009 The PHP Group|
   +--+
   | This source file is subject to version 3.01 of the PHP license,  |
   | that is bundled with this package in the file LICENSE, and is|
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.76 2009/03/17 22:02:05 mattwil Exp $ */
+/* $Id: var_unserializer.re,v 1.77 2009/03/17 23:02:22 felipe Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug45706.phpt serialization_objects_009.phpt

2008-08-29 Thread Dmitry Stogov
dmitry  Fri Aug 29 14:59:41 2008 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
/php-src/ext/standard/tests/serialize   bug45706.phpt 
serialization_objects_009.phpt 
  Log:
  Fixed bug #45706 (Unserialization of classes derived from ArrayIterator fails)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.95r2=1.96diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.95 
php-src/ext/standard/var_unserializer.c:1.96
--- php-src/ext/standard/var_unserializer.c:1.95Tue May 27 11:27:58 2008
+++ php-src/ext/standard/var_unserializer.c Fri Aug 29 14:59:41 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Tue May 27 06:15:01 2008 */
+/* Generated by re2c 0.13.5 on Fri Aug 29 18:45:19 2008 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.95 2008/05/27 11:27:58 mattwil Exp $ */
+/* $Id: var_unserializer.c,v 1.96 2008/08/29 14:59:41 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -363,11 +363,6 @@
zstr buf;
size_t buf_len;
 
-   if (ce-unserialize == NULL) {
-   zend_error(E_WARNING, Class %v has no unserializer, ce-name);
-   return 0;
-   }
-
datalen = parse_iv2((*p) + 2, p);
 
switch((*p)[1]) {
@@ -400,7 +395,10 @@
buf_len = datalen;
(*p) += datalen;
}
-   if (ce-unserialize(rval, ce, type, buf, buf_len, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+   if (ce-unserialize == NULL) {
+   zend_error(E_WARNING, Class %v has no unserializer, ce-name);
+   object_init_ex(*rval, ce);
+   } else if (ce-unserialize(rval, ce, type, buf, buf_len, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
if (type == IS_UNICODE) {
efree(buf.v);
}
@@ -463,7 +461,7 @@
start = cursor;
 
 
-#line 467 ext/standard/var_unserializer.c
+#line 465 ext/standard/var_unserializer.c
 {
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -524,9 +522,9 @@
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy103;
 yy3:
-#line 791 ext/standard/var_unserializer.re
+#line 794 ext/standard/var_unserializer.re
{ return 0; }
-#line 530 ext/standard/var_unserializer.c
+#line 528 ext/standard/var_unserializer.c
 yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy97;
@@ -573,13 +571,13 @@
goto yy3;
 yy15:
++YYCURSOR;
-#line 785 ext/standard/var_unserializer.re
+#line 788 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);
return 0; /* not sure if it should be 0 or 1 here? */
 }
-#line 583 ext/standard/var_unserializer.c
+#line 581 ext/standard/var_unserializer.c
 yy17:
yych = *++YYCURSOR;
goto yy3;
@@ -609,7 +607,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 672 ext/standard/var_unserializer.re
+#line 670 ext/standard/var_unserializer.re
{
size_t len, len2, len3, maxlen;
long elements;
@@ -709,8 +707,13 @@
*p = YYCURSOR;
 
if (custom_object) {
+   int ret = object_custom(UNSERIALIZE_PASSTHRU, ce);
+
+   if (ret  incomplete_class) {
+   php_store_class_name(*rval, class_name, len2);
+   }
efree(class_name.v);
-   return object_custom(UNSERIALIZE_PASSTHRU, ce);
+   return ret;
}
 
elements = object_common1(UNSERIALIZE_PASSTHRU, ce);
@@ -722,7 +725,7 @@
 
return object_common2(UNSERIALIZE_PASSTHRU, elements);
 }
-#line 726 ext/standard/var_unserializer.c
+#line 729 ext/standard/var_unserializer.c
 yy26:
yych = *++YYCURSOR;
if (yych = ',') {
@@ -747,7 +750,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 664 ext/standard/var_unserializer.re
+#line 662 ext/standard/var_unserializer.re
{
 
INIT_PZVAL(*rval);
@@ -755,7 +758,7 @@
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, 
ZEND_STANDARD_CLASS_DEF_PTR));
 }
-#line 759 ext/standard/var_unserializer.c
+#line 762 ext/standard/var_unserializer.c
 yy33:
yych = *++YYCURSOR;
if (yych == '+') goto yy34;
@@ -776,7 +779,7 @@
yych = *++YYCURSOR;
if (yych != '{') goto yy19;
++YYCURSOR;
-#line 644 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug43614.phpt

2008-03-18 Thread Felipe Pena
felipe  Wed Mar 19 03:12:39 2008 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
/php-src/ext/standard/tests/serialize   bug43614.phpt 
  Log:
  MFB: Fixed bug #43614 (incorrect processing of numerical string keys of array 
in arbitrary serialized data)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.93r2=1.94diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.93 
php-src/ext/standard/var_unserializer.c:1.94
--- php-src/ext/standard/var_unserializer.c:1.93Wed Oct 17 10:36:45 2007
+++ php-src/ext/standard/var_unserializer.c Wed Mar 19 03:12:39 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.12.1 on Mon Aug  6 21:30:07 2007 */
+/* Generated by re2c 0.12.3 on Wed Mar 19 00:06:59 2008 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.93 2007/10/17 10:36:45 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.94 2008/03/19 03:12:39 felipe Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -326,10 +326,10 @@
break;
case IS_STRING:
case IS_UNICODE:
-   if (zend_u_hash_find(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, (void **)old_data)==SUCCESS) {
+   if (zend_u_symtable_find(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, (void **)old_data)==SUCCESS) {
var_push_dtor(var_hash, old_data);
}
-   zend_u_hash_update(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, data, sizeof(data), NULL);
+   zend_u_symtable_update(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, data, sizeof(data), NULL);
break;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.72r2=1.73diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.72 
php-src/ext/standard/var_unserializer.re:1.73
--- php-src/ext/standard/var_unserializer.re:1.72   Wed Oct 17 10:36:45 2007
+++ php-src/ext/standard/var_unserializer.reWed Mar 19 03:12:39 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.72 2007/10/17 10:36:45 dmitry Exp $ */
+/* $Id: var_unserializer.re,v 1.73 2008/03/19 03:12:39 felipe Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -330,10 +330,10 @@
break;
case IS_STRING:
case IS_UNICODE:
-   if (zend_u_hash_find(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, (void **)old_data)==SUCCESS) {
+   if (zend_u_symtable_find(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, (void **)old_data)==SUCCESS) {
var_push_dtor(var_hash, old_data);
}
-   zend_u_hash_update(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, data, sizeof(data), NULL);
+   zend_u_symtable_update(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, data, sizeof(data), NULL);
break;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/bug43614.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/serialize/bug43614.phpt
diff -u /dev/null php-src/ext/standard/tests/serialize/bug43614.phpt:1.2
--- /dev/null   Wed Mar 19 03:12:39 2008
+++ php-src/ext/standard/tests/serialize/bug43614.phpt  Wed Mar 19 03:12:39 2008
@@ -0,0 +1,21 @@
+--TEST--
+Bug #43614 (incorrect processing of numerical string keys of array in 
arbitrary serialized data)
+--FILE--
+?php
+
+error_reporting(E_ALL);
+
+var_dump($a = unserialize('a:2:{s:2:10;i:1;s:2:01;i:2;}'));
+var_dump($a['10']);
+var_dump($a['01']);
+
+?
+--EXPECT--
+array(2) {
+  [10]=
+  int(1)
+  [01]=
+  int(2)
+}
+int(1)
+int(2)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug42919.phpt

2007-10-17 Thread Dmitry Stogov
dmitry  Wed Oct 17 10:36:45 2007 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
/php-src/ext/standard/tests/serialize   bug42919.phpt 
  Log:
  Fixed bug #42919 (Unserializing of namespaced class object fails)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.92r2=1.93diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.92 
php-src/ext/standard/var_unserializer.c:1.93
--- php-src/ext/standard/var_unserializer.c:1.92Sun Oct  7 05:15:06 2007
+++ php-src/ext/standard/var_unserializer.c Wed Oct 17 10:36:45 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.92 2007/10/07 05:15:06 davidw Exp $ */
+/* $Id: var_unserializer.c,v 1.93 2007/10/17 10:36:45 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -641,7 +641,7 @@
if (UG(unicode)) {
class_name.u = unserialize_ustr(YYCURSOR, len);
} else {
-   len3 = strspn((char*)YYCURSOR, 
0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377);
+   len3 = strspn((char*)YYCURSOR, 
0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:);
if (len3 != len) {
*p = YYCURSOR + len3 - len;
return 0;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.71r2=1.72diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.71 
php-src/ext/standard/var_unserializer.re:1.72
--- php-src/ext/standard/var_unserializer.re:1.71   Sun Oct  7 05:15:06 2007
+++ php-src/ext/standard/var_unserializer.reWed Oct 17 10:36:45 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.71 2007/10/07 05:15:06 davidw Exp $ */
+/* $Id: var_unserializer.re,v 1.72 2007/10/17 10:36:45 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -701,7 +701,7 @@
if (UG(unicode)) {
class_name.u = unserialize_ustr(YYCURSOR, len);
} else {
-   len3 = strspn((char*)YYCURSOR, 
0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377);
+   len3 = strspn((char*)YYCURSOR, 
0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:);
if (len3 != len) {
*p = YYCURSOR + len3 - len;
return 0;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/bug42919.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/serialize/bug42919.phpt
diff -u /dev/null php-src/ext/standard/tests/serialize/bug42919.phpt:1.2
--- /dev/null   Wed Oct 17 10:36:45 2007
+++ 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2007-08-06 Thread Jani Taskinen
janiMon Aug  6 18:30:53 2007 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  Touch generated file
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.89r2=1.90diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.89 
php-src/ext/standard/var_unserializer.c:1.90
--- php-src/ext/standard/var_unserializer.c:1.89Mon Jul  9 15:58:52 2007
+++ php-src/ext/standard/var_unserializer.c Mon Aug  6 18:30:53 2007
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.2 on Tue Mar 27 13:27:10 2007 */
+/* Generated by re2c 0.12.1 on Mon Aug  6 21:30:07 2007 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.89 2007/07/09 15:58:52 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.90 2007/08/06 18:30:53 jani Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -118,7 +118,7 @@
char *str = safe_emalloc(*len, 1, 1);
unsigned char *end = *(unsigned char **)p+maxlen;
 
-   if(end  *p) {
+   if (end  *p) {
efree(str);
return NULL;
}
@@ -159,7 +159,7 @@
 {
long i;
var_entries *var_hash = var_hashx-first;
-   
+
while (var_hash) {
for (i = 0; i  var_hash-used_slots; i++) {
if (var_hash-data[i] == ozval) {
@@ -174,7 +174,7 @@
 static int var_access(php_unserialize_data_t *var_hashx, long id, zval 
***store)
 {
var_entries *var_hash = var_hashx-first;
-   
+
while (id = VAR_ENTRIES_MAX  var_hash  var_hash-used_slots == 
VAR_ENTRIES_MAX) {
var_hash = var_hash-next;
id -= VAR_ENTRIES_MAX;
@@ -194,7 +194,7 @@
void *next;
long i;
var_entries *var_hash = var_hashx-first;
-   
+
while (var_hash) {
next = var_hash-next;
efree(var_hash);
@@ -202,7 +202,7 @@
}
 
var_hash = var_hashx-first_dtor;
-   
+
while (var_hash) {
for (i = 0; i  var_hash-used_slots; i++) {
zval_ptr_dtor(var_hash-data[i]);
@@ -222,7 +222,7 @@
 #define YYMARKER marker
 
 
-#line 226 ext/standard/var_unserializer.re
+#line 230 ext/standard/var_unserializer.re
 
 
 
@@ -240,7 +240,7 @@
case '+':
p++;
}
-   
+
while (1) {
cursor = (char)*p;
if (cursor = '0'  cursor = '9') {
@@ -269,7 +269,7 @@
if (*p == '+') {
p++;
}
-   
+
while (1) {
cursor = *p;
if (cursor = '0'  cursor = '9') {
@@ -299,8 +299,9 @@
}
 
if (Z_TYPE_P(key) != IS_LONG 
-   Z_TYPE_P(key) != IS_STRING 
-   Z_TYPE_P(key) != IS_UNICODE) {
+   Z_TYPE_P(key) != IS_STRING 
+   Z_TYPE_P(key) != IS_UNICODE
+   ) {
zval_dtor(key);
FREE_ZVAL(key);
return 0;
@@ -331,11 +332,11 @@
zend_u_hash_update(ht, Z_TYPE_P(key), 
Z_UNIVAL_P(key), Z_UNILEN_P(key) + 1, data, sizeof(data), NULL);
break;
}
-   
+
zval_dtor(key);
FREE_ZVAL(key);
 
-   if (elements  *(*p-1) != ';'   *(*p-1) != '}') {
+   if (elements  *(*p-1) != ';'  *(*p-1) != '}') {
(*p)--;
return 0;
}
@@ -346,7 +347,7 @@
 
 static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
 {
-   if (*((*p)++) == '}') 
+   if (*((*p)++) == '}')
return 1;
 
 #if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE
@@ -362,7 +363,7 @@
zstr buf;
size_t buf_len;
 
-   if(ce-unserialize == NULL) {
+   if (ce-unserialize == NULL) {
zend_error(E_WARNING, Class %v has no unserializer, ce-name);
return 0;
}
@@ -385,9 +386,9 @@
zend_error(E_WARNING, Illegal data for unserializing);
return 0;
}
-  
-   if(datalen  0 || (*p) + datalen = max) {
-   zend_error(E_WARNING, Insufficient data for unserializing - 
%ld required, %d present, datalen, max - (*p));
+
+   if (datalen  0 || (*p) + datalen = max) {
+   zend_error(E_WARNING, Insufficient data for unserializing - 
%ld required, %ld present, datalen, max - (*p));
return 0;
}
 
@@ -399,7 +400,7 @@
buf_len = datalen;
(*p) += datalen;
}
-   if(ce-unserialize(rval, ce, type, buf, 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2007-07-09 Thread Dmitry Stogov
dmitry  Mon Jul  9 13:43:51 2007 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Fixed deserialization of escaped strings
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.86r2=1.87diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.86 
php-src/ext/standard/var_unserializer.c:1.87
--- php-src/ext/standard/var_unserializer.c:1.86Tue Mar 27 09:28:49 2007
+++ php-src/ext/standard/var_unserializer.c Mon Jul  9 13:43:50 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.86 2007/03/27 09:28:49 tony2001 Exp $ */
+/* $Id: var_unserializer.c,v 1.87 2007/07/09 13:43:50 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -142,6 +142,7 @@
return NULL;
}
}
+   end += 2;
str[i] = (char)ch;
}
(*p)++;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.64r2=1.65diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.64 
php-src/ext/standard/var_unserializer.re:1.65
--- php-src/ext/standard/var_unserializer.re:1.64   Tue Mar 27 09:28:49 2007
+++ php-src/ext/standard/var_unserializer.reMon Jul  9 13:43:50 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.64 2007/03/27 09:28:49 tony2001 Exp $ */
+/* $Id: var_unserializer.re,v 1.65 2007/07/09 13:43:50 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -140,6 +140,7 @@
return NULL;
}
}
+   end += 2;
str[i] = (char)ch;
}
(*p)++;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize unserializeS.phpt

2007-07-09 Thread Dmitry Stogov
dmitry  Mon Jul  9 14:33:37 2007 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
/php-src/ext/standard/tests/serialize   unserializeS.phpt 
  Log:
  Proper fix for MOPB-29
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.87r2=1.88diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.87 
php-src/ext/standard/var_unserializer.c:1.88
--- php-src/ext/standard/var_unserializer.c:1.87Mon Jul  9 13:43:50 2007
+++ php-src/ext/standard/var_unserializer.c Mon Jul  9 14:33:37 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.87 2007/07/09 13:43:50 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.88 2007/07/09 14:33:37 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -112,18 +112,22 @@
return ustr;
 }
 
-static char *unserialize_str(const unsigned char **p, int *len)
+static char *unserialize_str(const unsigned char **p, size_t *len, size_t 
maxlen)
 {
size_t i, j;
char *str = safe_emalloc(*len, 1, 1);
-   unsigned char *end = *(unsigned char **)p+*len;
+   unsigned char *end = *(unsigned char **)p+maxlen;
 
if(end  *p) {
efree(str);
return NULL;
}
 
-   for (i = 0; i  *len  *p  end; i++) {
+   for (i = 0; i  *len; i++) {
+   if (*p = end) {
+   efree(str);
+   return NULL;
+   }
if (**p != '\\') {
str[i] = (char)**p;
} else {
@@ -142,7 +146,6 @@
return NULL;
}
}
-   end += 2;
str[i] = (char)ch;
}
(*p)++;
@@ -866,7 +869,7 @@
return 0;
}
 
-   if ((str = unserialize_str(YYCURSOR, len)) == NULL) {
+   if ((str = unserialize_str(YYCURSOR, len, maxlen)) == NULL) {
return 0;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.65r2=1.66diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.65 
php-src/ext/standard/var_unserializer.re:1.66
--- php-src/ext/standard/var_unserializer.re:1.65   Mon Jul  9 13:43:50 2007
+++ php-src/ext/standard/var_unserializer.reMon Jul  9 14:33:37 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.65 2007/07/09 13:43:50 dmitry Exp $ */
+/* $Id: var_unserializer.re,v 1.66 2007/07/09 14:33:37 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -110,18 +110,22 @@
return ustr;
 }
 
-static char *unserialize_str(const unsigned char **p, int *len)
+static char *unserialize_str(const unsigned char **p, size_t *len, size_t 
maxlen)
 {
size_t i, j;
char *str = safe_emalloc(*len, 1, 1);
-   unsigned char *end = *(unsigned char **)p+*len;
+   unsigned char *end = *(unsigned char **)p+maxlen;
 
if(end  *p) {
efree(str);
return NULL;
}
 
-   for (i = 0; i  *len  *p  end; i++) {
+   for (i = 0; i  *len; i++) {
+   if (*p = end) {
+   efree(str);
+   return NULL;
+   }
if (**p != '\\') {
str[i] = (char)**p;
} else {
@@ -140,7 +144,6 @@
return NULL;
}
}
-   end += 2;
str[i] = (char)ch;
}
(*p)++;
@@ -578,7 +581,7 @@
return 0;
}
 
-   if ((str = unserialize_str(YYCURSOR, len)) == NULL) {
+   if ((str = unserialize_str(YYCURSOR, len, maxlen)) == NULL) {
return 0;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/unserializeS.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/serialize/unserializeS.phpt
diff -u php-src/ext/standard/tests/serialize/unserializeS.phpt:1.2 
php-src/ext/standard/tests/serialize/unserializeS.phpt:1.3
--- php-src/ext/standard/tests/serialize/unserializeS.phpt:1.2  Fri Mar 23 
20:34:11 2007
+++ php-src/ext/standard/tests/serialize/unserializeS.phpt  Mon Jul  9 
14:33:37 2007
@@ -11,4 +11,4 @@
 var_dump($data);
 
 --EXPECT--
-string(100) 

+bool(false)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2007-07-09 Thread Dmitry Stogov
dmitry  Mon Jul  9 15:58:52 2007 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Fixed custom unserialixe() in unicode mode
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.88r2=1.89diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.88 
php-src/ext/standard/var_unserializer.c:1.89
--- php-src/ext/standard/var_unserializer.c:1.88Mon Jul  9 14:33:37 2007
+++ php-src/ext/standard/var_unserializer.c Mon Jul  9 15:58:52 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.88 2007/07/09 14:33:37 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.89 2007/07/09 15:58:52 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -359,6 +359,8 @@
 {
long datalen;
int type;
+   zstr buf;
+   size_t buf_len;
 
if(ce-unserialize == NULL) {
zend_error(E_WARNING, Class %v has no unserializer, ce-name);
@@ -389,11 +391,23 @@
return 0;
}
 
-   if(ce-unserialize(rval, ce, type, ZSTR((char*)*p), datalen, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+   if (type == IS_UNICODE) {
+   buf.u = unserialize_ustr(p, datalen);
+   buf_len = u_strlen(buf.u);
+   } else {
+   buf.s = (char*)*p;
+   buf_len = datalen;
+   (*p) += datalen;
+   }
+   if(ce-unserialize(rval, ce, type, buf, buf_len, (zend_unserialize_data 
*)var_hash TSRMLS_CC) != SUCCESS) {
+   if (type == IS_UNICODE) {
+   efree(buf.v);
+   }
return 0;
}
-
-   (*p) += datalen;
+   if (type == IS_UNICODE) {
+   efree(buf.v);
+   }
 
return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.66r2=1.67diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.66 
php-src/ext/standard/var_unserializer.re:1.67
--- php-src/ext/standard/var_unserializer.re:1.66   Mon Jul  9 14:33:37 2007
+++ php-src/ext/standard/var_unserializer.reMon Jul  9 15:58:52 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.66 2007/07/09 14:33:37 dmitry Exp $ */
+/* $Id: var_unserializer.re,v 1.67 2007/07/09 15:58:52 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -363,6 +363,8 @@
 {
long datalen;
int type;
+   zstr buf;
+   size_t buf_len;
 
if(ce-unserialize == NULL) {
zend_error(E_WARNING, Class %v has no unserializer, ce-name);
@@ -393,11 +395,23 @@
return 0;
}
 
-   if(ce-unserialize(rval, ce, type, ZSTR((char*)*p), datalen, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+   if (type == IS_UNICODE) {
+   buf.u = unserialize_ustr(p, datalen);
+   buf_len = u_strlen(buf.u);
+   } else {
+   buf.s = (char*)*p;
+   buf_len = datalen;
+   (*p) += datalen;
+   }
+   if(ce-unserialize(rval, ce, type, buf, buf_len, (zend_unserialize_data 
*)var_hash TSRMLS_CC) != SUCCESS) {
+   if (type == IS_UNICODE) {
+   efree(buf.v);
+   }
return 0;
}
-
-   (*p) += datalen;
+   if (type == IS_UNICODE) {
+   efree(buf.v);
+   }
 
return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2007-03-27 Thread Antony Dovgal
tony2001Tue Mar 27 09:28:49 2007 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.re var_unserializer.c 
  Log:
  fix compile warning
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.63r2=1.64diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.63 
php-src/ext/standard/var_unserializer.re:1.64
--- php-src/ext/standard/var_unserializer.re:1.63   Fri Mar 23 20:34:11 2007
+++ php-src/ext/standard/var_unserializer.reTue Mar 27 09:28:49 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.63 2007/03/23 20:34:11 stas Exp $ */
+/* $Id: var_unserializer.re,v 1.64 2007/03/27 09:28:49 tony2001 Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -114,7 +114,7 @@
 {
size_t i, j;
char *str = safe_emalloc(*len, 1, 1);
-   unsigned char *end = *p+*len;
+   unsigned char *end = *(unsigned char **)p+*len;
 
if(end  *p) {
efree(str);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.85r2=1.86diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.85 
php-src/ext/standard/var_unserializer.c:1.86
--- php-src/ext/standard/var_unserializer.c:1.85Fri Mar 23 20:34:11 2007
+++ php-src/ext/standard/var_unserializer.c Tue Mar 27 09:28:49 2007
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.2 on Fri Mar 23 13:33:19 2007 */
+/* Generated by re2c 0.11.2 on Tue Mar 27 13:27:10 2007 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.85 2007/03/23 20:34:11 stas Exp $ */
+/* $Id: var_unserializer.c,v 1.86 2007/03/27 09:28:49 tony2001 Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -116,7 +116,7 @@
 {
size_t i, j;
char *str = safe_emalloc(*len, 1, 1);
-   unsigned char *end = *p+*len;
+   unsigned char *end = *(unsigned char **)p+*len;
 
if(end  *p) {
efree(str);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize 002.phpt

2006-03-27 Thread Dmitry Stogov
dmitry  Mon Mar 27 14:19:18 2006 UTC

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
/php-src/ext/standard/tests/serialize   002.phpt 
  Log:
  Unicode support
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/var_unserializer.c?r1=1.79r2=1.80diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.79 
php-src/ext/standard/var_unserializer.c:1.80
--- php-src/ext/standard/var_unserializer.c:1.79Mon Mar 27 13:37:46 2006
+++ php-src/ext/standard/var_unserializer.c Mon Mar 27 14:19:18 2006
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.10 on Mon Mar 27 17:29:16 2006 */
+/* Generated by re2c 0.9.10 on Mon Mar 27 17:59:43 2006 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.79 2006/03/27 13:37:46 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.80 2006/03/27 14:19:18 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -838,7 +838,7 @@
*p = YYCURSOR;
 
INIT_PZVAL(*rval);
-   ZVAL_STRINGL(*rval, str, len, 1);
+   ZVAL_RT_STRINGL(*rval, str, len, 1);
return 1;
 }
 #line 845 ext/standard/var_unserializer.c
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/var_unserializer.re?r1=1.58r2=1.59diff_format=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.58 
php-src/ext/standard/var_unserializer.re:1.59
--- php-src/ext/standard/var_unserializer.re:1.58   Mon Mar 27 13:37:46 2006
+++ php-src/ext/standard/var_unserializer.reMon Mar 27 14:19:18 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.58 2006/03/27 13:37:46 dmitry Exp $ */
+/* $Id: var_unserializer.re,v 1.59 2006/03/27 14:19:18 dmitry Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -507,7 +507,7 @@
*p = YYCURSOR;
 
INIT_PZVAL(*rval);
-   ZVAL_STRINGL(*rval, str, len, 1);
+   ZVAL_RT_STRINGL(*rval, str, len, 1);
return 1;
 }
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/serialize/002.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/standard/tests/serialize/002.phpt
diff -u php-src/ext/standard/tests/serialize/002.phpt:1.4 
php-src/ext/standard/tests/serialize/002.phpt:1.5
--- php-src/ext/standard/tests/serialize/002.phpt:1.4   Sun Sep 26 18:28:07 2004
+++ php-src/ext/standard/tests/serialize/002.phpt   Mon Mar 27 14:19:18 2006
@@ -42,3 +42,32 @@
 object(stdClass)#%d (0) {
 }
 ===DONE===
+--UEXPECTF--
+bool(false)
+bool(true)
+int(823)
+unicode(0) 
+unicode(3) foo
+array(1) {
+  [0]=
+  unicode(2) 12
+}
+array(2) {
+  [0]=
+  array(0) {
+  }
+  [1]=
+  array(0) {
+  }
+}
+array(3) {
+  [0]=
+  unicode(3) foo
+  [1]=
+  unicode(3) bar
+  [2]=
+  unicode(3) baz
+}
+object(stdClass)#%d (0) {
+}
+===DONE===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-09-05 Thread Jani Taskinen
sniper  Mon Sep  5 12:20:56 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  touch
  http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.71r2=1.72ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.71 
php-src/ext/standard/var_unserializer.c:1.72
--- php-src/ext/standard/var_unserializer.c:1.71Thu Aug 11 19:36:00 2005
+++ php-src/ext/standard/var_unserializer.c Mon Sep  5 12:20:56 2005
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.9.8 on Wed Jun 29 02:16:55 2005 */
-#line 1 /usr/src/php/php5/ext/standard/var_unserializer.re
+/* Generated by re2c 0.9.10 on Mon Sep  5 19:20:33 2005 */
+#line 1 /usr/src/php/php6/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 5|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.71 2005/08/11 23:36:00 andrei Exp $ */
+/* $Id: var_unserializer.c,v 1.72 2005/09/05 16:20:56 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -147,7 +147,7 @@
 #define YYMARKER marker
 
 
-#line 155 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 155 /usr/src/php/php6/ext/standard/var_unserializer.re
 
 
 
@@ -399,118 +399,90 @@
 yy0:
if((YYLIMIT - YYCURSOR)  7) YYFILL(7);
yych = *YYCURSOR;
-   if(yych = 'c'){
-   if(yych = 'O'){
-   if(yych = 'C'){
-   if(yych = 'B') goto yy16;
-   goto yy13;
-   } else {
-   if(yych = 'M') goto yy16;
-   if(yych = 'N') goto yy6;
-   goto yy13;
-   }
-   } else {
-   if(yych = '`'){
-   if(yych == 'R') goto yy3;
-   goto yy16;
-   } else {
-   if(yych = 'a') goto yy11;
-   if(yych = 'b') goto yy7;
-   goto yy16;
-   }
-   }
-   } else {
-   if(yych = 'q'){
-   if(yych = 'i'){
-   if(yych = 'd') goto yy9;
-   if(yych = 'h') goto yy16;
-   goto yy8;
-   } else {
-   if(yych == 'o') goto yy12;
-   goto yy16;
-   }
-   } else {
-   if(yych = '|'){
-   if(yych = 'r') goto yy5;
-   if(yych = 's') goto yy10;
-   goto yy16;
-   } else {
-   if(yych = '}') goto yy14;
-   if(yych = 0xBF)goto yy16;
-   goto yy2;
-   }
-   }
-   }
-yy2:   YYCURSOR = YYMARKER;
-   switch(yyaccept){
-   case 0: goto yy4;
+   switch(yych){
+   case 'C':   case 'O':   goto yy12;
+   case 'N':   goto yy5;
+   case 'R':   goto yy2;
+   case 'a':   goto yy10;
+   case 'b':   goto yy6;
+   case 'd':   goto yy8;
+   case 'i':   goto yy7;
+   case 'o':   goto yy11;
+   case 'r':   goto yy4;
+   case 's':   goto yy9;
+   case '}':   goto yy13;
+   default:goto yy15;
}
-yy3:   yyaccept = 0;
+yy2:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy87;
-   goto yy4;
-yy4:
-#line 626 /usr/src/php/php5/ext/standard/var_unserializer.re
+   goto yy3;
+yy3:
+#line 626 /usr/src/php/php6/ext/standard/var_unserializer.re
 { return 0; }
-#line 456 stdout
-yy5:   yyaccept = 0;
+#line 424 stdout
+yy4:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy81;
-   goto yy4;
-yy6:   yych = *++YYCURSOR;
+   goto yy3;
+yy5:   yych = *++YYCURSOR;
if(yych == ';') goto yy79;
-   goto yy4;
-yy7:   yyaccept = 0;
+   goto yy3;
+yy6:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy75;
-   goto yy4;
-yy8:   yyaccept = 0;
+   goto yy3;
+yy7:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy69;
-   goto yy4;
-yy9:   yyaccept = 0;
+   goto yy3;
+yy8:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy45;
-   goto yy4;
-yy10:  yyaccept = 0;
+   goto yy3;
+yy9:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy38;
-   goto yy4;
-yy11:  

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-06-02 Thread Jani Taskinen
sniper  Thu Jun  2 01:49:57 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  touch
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.65r2=1.66ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.65 
php-src/ext/standard/var_unserializer.c:1.66
--- php-src/ext/standard/var_unserializer.c:1.65Wed Jun  1 07:03:42 2005
+++ php-src/ext/standard/var_unserializer.c Thu Jun  2 01:49:56 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.6 on Tue May 31 11:09:13 2005 */
+/* Generated by re2c 0.9.6 on Thu Jun  2 08:48:59 2005 */
 #line 1 /usr/src/php/php5/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.65 2005/06/01 11:03:42 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.66 2005/06/02 05:49:56 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -449,7 +449,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 625 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 626 /usr/src/php/php5/ext/standard/var_unserializer.re
 { return 0; }
 #line 103 stdout
 yy5:   yyaccept = 0;
@@ -490,7 +490,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 619 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 620 /usr/src/php/php5/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);
@@ -525,7 +525,7 @@
 yy22:  ++YYCURSOR;
goto yy23;
 yy23:
-#line 507 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 508 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
size_t len, len2, len3, maxlen;
long elements;
@@ -666,7 +666,7 @@
 yy29:  ++YYCURSOR;
goto yy30;
 yy30:
-#line 499 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 500 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
 
INIT_PZVAL(*rval);
@@ -698,7 +698,7 @@
 yy36:  ++YYCURSOR;
goto yy37;
 yy37:
-#line 477 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 478 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -744,7 +744,7 @@
 yy43:  ++YYCURSOR;
goto yy44;
 yy44:
-#line 449 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 450 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
size_t len, maxlen;
char *str;
@@ -861,7 +861,7 @@
 yy55:  ++YYCURSOR;
goto yy56;
 yy56:
-#line 442 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 443 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -928,7 +928,7 @@
 yy66:  ++YYCURSOR;
goto yy67;
 yy67:
-#line 427 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 428 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -972,7 +972,7 @@
 yy73:  ++YYCURSOR;
goto yy74;
 yy74:
-#line 420 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 421 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -990,7 +990,7 @@
 yy77:  ++YYCURSOR;
goto yy78;
 yy78:
-#line 413 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 414 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1001,7 +1001,7 @@
 yy79:  ++YYCURSOR;
goto yy80;
 yy80:
-#line 406 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 407 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1034,7 +1034,7 @@
 yy85:  ++YYCURSOR;
goto yy86;
 yy86:
-#line 383 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 384 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
long id;
 
@@ -1083,7 +1083,7 @@
 yy91:  ++YYCURSOR;
goto yy92;
 yy92:
-#line 362 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 363 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
long id;
 
@@ -1106,7 +1106,7 @@
 }
 #line 767 stdout
 }
-#line 627 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 628 /usr/src/php/php5/ext/standard/var_unserializer.re
 
 
return 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-05-31 Thread Jani Taskinen
sniper  Tue May 31 05:41:46 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  Touch
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.63r2=1.64ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.63 
php-src/ext/standard/var_unserializer.c:1.64
--- php-src/ext/standard/var_unserializer.c:1.63Thu Apr 14 18:38:29 2005
+++ php-src/ext/standard/var_unserializer.c Tue May 31 05:41:46 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.6 on Fri Apr 15 01:37:39 2005 */
+/* Generated by re2c 0.9.6 on Tue May 31 11:09:13 2005 */
 #line 1 /usr/src/php/php5/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.63 2005/04/14 22:38:29 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.64 2005/05/31 09:41:46 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -565,7 +565,7 @@
return 0;
}
 
-   len3 = strspn(class_name, 
0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ);
+   len3 = strspn(class_name, 
0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377);
if (len3 != len)
{
*p = YYCURSOR + len3 - len;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-03-09 Thread Marcus Boerger
helly   Wed Mar  9 18:58:45 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  - Fix #31442 unserialize broken on 64-bit systems 
  - Fix one warning
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.60r2=1.61ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.60 
php-src/ext/standard/var_unserializer.c:1.61
--- php-src/ext/standard/var_unserializer.c:1.60Tue Mar  8 01:40:05 2005
+++ php-src/ext/standard/var_unserializer.c Wed Mar  9 18:58:44 2005
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.9.4 on Tue Mar  8 08:39:34 2005 */
-#line 1 /usr/src/php/php5/ext/standard/var_unserializer.re
+/* Generated by re2c 0.9.4 on Thu Mar 10 00:54:25 2005 */
+#line 1 /usr/src/php-cvs/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 5|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.60 2005/03/08 06:40:05 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.61 2005/03/09 23:58:44 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,15 +147,15 @@
 #define YYMARKER marker
 
 
-#line 155 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 155 /usr/src/php-cvs/ext/standard/var_unserializer.re
 
 
 
 
-static inline int parse_iv2(const unsigned char *p, const unsigned char **q)
+static inline long parse_iv2(const unsigned char *p, const unsigned char **q)
 {
char cursor;
-   int result = 0;
+   long result = 0;
int neg = 0;
 
switch (*p) {
@@ -180,7 +180,7 @@
return result;
 }
 
-static inline int parse_iv(const unsigned char *p)
+static inline long parse_iv(const unsigned char *p)
 {
return parse_iv2(p, NULL);
 }
@@ -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_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
 {
-   int datalen;
+   long datalen;
 
if(ce-unserialize == NULL) {
zend_error(E_WARNING, Class %s has no unserializer, ce-name);
@@ -291,7 +291,7 @@
(*p) += 2;
 
if(datalen  0 || (*p) + datalen = max) {
-   zend_error(E_WARNING, Insufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
+   zend_error(E_WARNING, Insufficient data for unserializing - 
%ld required, %d present, datalen, max - (*p));
return 0;
}
 
@@ -304,10 +304,10 @@
return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }
 
-static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
 {
-   int elements;
-
+   long elements;
+   
elements = parse_iv2((*p) + 2, p);
 
(*p) += 2;
@@ -316,7 +316,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;
@@ -448,7 +448,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 625 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 625 /usr/src/php-cvs/ext/standard/var_unserializer.re
 { return 0; }
 #line 103 stdout
 yy5:   yyaccept = 0;
@@ -489,7 +489,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 619 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 619 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-03-09 Thread Marcus Boerger
helly   Wed Mar  9 19:17:18 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  - Wrong order of action - touch
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.61r2=1.62ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.61 
php-src/ext/standard/var_unserializer.c:1.62
--- php-src/ext/standard/var_unserializer.c:1.61Wed Mar  9 18:58:44 2005
+++ php-src/ext/standard/var_unserializer.c Wed Mar  9 19:17:17 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Thu Mar 10 00:54:25 2005 */
+/* Generated by re2c 0.9.4 on Thu Mar 10 01:10:07 2005 */
 #line 1 /usr/src/php-cvs/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.61 2005/03/09 23:58:44 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.62 2005/03/10 00:17:17 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-03-07 Thread Jani Taskinen
sniper  Tue Mar  8 01:40:05 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  update
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.59r2=1.60ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.59 
php-src/ext/standard/var_unserializer.c:1.60
--- php-src/ext/standard/var_unserializer.c:1.59Tue Mar  1 04:26:28 2005
+++ php-src/ext/standard/var_unserializer.c Tue Mar  8 01:40:05 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Tue Mar  1 03:49:26 2005 */
+/* Generated by re2c 0.9.4 on Tue Mar  8 08:39:34 2005 */
 #line 1 /usr/src/php/php5/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.59 2005/03/01 09:26:28 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.60 2005/03/08 06:40:05 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -294,8 +294,8 @@
zend_error(E_WARNING, Insufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
return 0;
}
-   
-   if(ce-unserialize(rval, *p, datalen, (zend_unserialize_data *)var_hash 
TSRMLS_CC) != SUCCESS) {
+
+   if(ce-unserialize(rval, ce, (const unsigned char*)*p, datalen, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
return 0;
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-03-01 Thread Jani Taskinen
sniper  Tue Mar  1 04:26:29 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  update
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.58r2=1.59ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.58 
php-src/ext/standard/var_unserializer.c:1.59
--- php-src/ext/standard/var_unserializer.c:1.58Sun Feb 27 06:30:41 2005
+++ php-src/ext/standard/var_unserializer.c Tue Mar  1 04:26:28 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Thu Feb 24 19:48:52 2005 */
+/* Generated by re2c 0.9.4 on Tue Mar  1 03:49:26 2005 */
 #line 1 /usr/src/php/php5/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.58 2005/02/27 11:30:41 stas Exp $ */
+/* $Id: var_unserializer.c,v 1.59 2005/03/01 09:26:28 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -448,7 +448,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 621 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 625 /usr/src/php/php5/ext/standard/var_unserializer.re
 { return 0; }
 #line 103 stdout
 yy5:   yyaccept = 0;
@@ -489,7 +489,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 615 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 619 /usr/src/php/php5/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);
@@ -518,7 +518,7 @@
 yy22:  ++YYCURSOR;
goto yy23;
 yy23:
-#line 503 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 507 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
size_t len, len2, len3, maxlen;
int elements;
@@ -659,7 +659,7 @@
 yy29:  ++YYCURSOR;
goto yy30;
 yy30:
-#line 495 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 499 /usr/src/php/php5/ext/standard/var_unserializer.re
 {
 
INIT_PZVAL(*rval);
@@ -697,6 +697,10 @@
 
*p = YYCURSOR;
 
+   if (elements  0) {
+   return 0;
+   }
+
INIT_PZVAL(*rval);
Z_TYPE_PP(rval) = IS_ARRAY;
ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
@@ -709,7 +713,7 @@
 
return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }
-#line 365 stdout
+#line 369 stdout
 yy38:  yych = *++YYCURSOR;
if(yych == '+') goto yy39;
if(yych = '/') goto yy2;
@@ -761,7 +765,7 @@
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
 }
-#line 418 stdout
+#line 422 stdout
 yy45:  yych = *++YYCURSOR;
if(yych = '/'){
if(yych = ','){
@@ -857,7 +861,7 @@
ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
return 1;
 }
-#line 516 stdout
+#line 520 stdout
 yy57:  yych = *++YYCURSOR;
if(yych = ','){
if(yych != '+') goto yy2;
@@ -932,7 +936,7 @@
 
return 1;
 }
-#line 593 stdout
+#line 597 stdout
 yy68:  yych = *++YYCURSOR;
if(yych == 'N') goto yy65;
goto yy2;
@@ -968,7 +972,7 @@
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
 }
-#line 630 stdout
+#line 634 stdout
 yy75:  yych = *++YYCURSOR;
if(yych = '/') goto yy2;
if(yych = '2') goto yy2;
@@ -986,7 +990,7 @@
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
 }
-#line 648 stdout
+#line 652 stdout
 yy79:  ++YYCURSOR;
goto yy80;
 yy80:
@@ -997,7 +1001,7 @@
ZVAL_NULL(*rval);
return 1;
 }
-#line 659 stdout
+#line 663 stdout
 yy81:  yych = *++YYCURSOR;
if(yych = ','){
if(yych != '+') goto yy2;
@@ -1046,7 +1050,7 @@

return 1;
 }
-#line 709 stdout
+#line 713 stdout
 yy87:  yych = *++YYCURSOR;
if(yych = ','){
if(yych != '+') goto yy2;
@@ -1093,9 +1097,9 @@

return 1;
 }
-#line 757 stdout
+#line 761 stdout
 }
-#line 623 /usr/src/php/php5/ext/standard/var_unserializer.re
+#line 627 /usr/src/php/php5/ext/standard/var_unserializer.re
 
 
return 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2005-02-27 Thread Stanislav Malyshev
stasSun Feb 27 06:30:42 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  fix typo
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.57r2=1.58ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.57 
php-src/ext/standard/var_unserializer.c:1.58
--- php-src/ext/standard/var_unserializer.c:1.57Thu Feb 24 12:50:20 2005
+++ php-src/ext/standard/var_unserializer.c Sun Feb 27 06:30:41 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.57 2005/02/24 17:50:20 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.58 2005/02/27 11:30:41 stas Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -291,7 +291,7 @@
(*p) += 2;
 
if(datalen  0 || (*p) + datalen = max) {
-   zend_error(E_WARNING, Unsufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
+   zend_error(E_WARNING, Insufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
return 0;
}

http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.44r2=1.45ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.44 
php-src/ext/standard/var_unserializer.re:1.45
--- php-src/ext/standard/var_unserializer.re:1.44   Thu Feb 24 05:58:16 2005
+++ php-src/ext/standard/var_unserializer.reSun Feb 27 06:30:41 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.44 2005/02/24 10:58:16 stas Exp $ */
+/* $Id: var_unserializer.re,v 1.45 2005/02/27 11:30:41 stas Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -295,7 +295,7 @@
(*p) += 2;
 
if(datalen  0 || (*p) + datalen = max) {
-   zend_error(E_WARNING, Unsufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
+   zend_error(E_WARNING, Insufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
return 0;
}


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-02-25 Thread Jani Taskinen
sniper  Thu Feb 24 12:50:21 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  - Generated with re2c 0.9.4
  
  http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.56r2=1.57ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.56 
php-src/ext/standard/var_unserializer.c:1.57
--- php-src/ext/standard/var_unserializer.c:1.56Thu Feb 24 05:58:16 2005
+++ php-src/ext/standard/var_unserializer.c Thu Feb 24 12:50:20 2005
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Tue Feb 22 15:14:56 2005 */
-#line 1 /php5/ext/standard/var_unserializer.re
+/* Generated by re2c 0.9.4 on Thu Feb 24 19:48:52 2005 */
+#line 1 /usr/src/php/php5/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 5|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.56 2005/02/24 10:58:16 stas Exp $ */
+/* $Id: var_unserializer.c,v 1.57 2005/02/24 17:50:20 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -147,7 +147,7 @@
 #define YYMARKER marker
 
 
-#line 155
+#line 155 /usr/src/php/php5/ext/standard/var_unserializer.re
 
 
 
@@ -353,6 +353,8 @@
 


+
+#line 7 stdout
 {
YYCTYPE yych;
unsigned int yyaccept;
@@ -432,7 +434,8 @@
goto yy16;
} else {
if(yych = '}') goto yy14;
-   if(yych = '\277')  goto yy16;
+   if(yych = 0xBF)goto yy16;
+   goto yy2;
}
}
}
@@ -443,9 +446,11 @@
 yy3:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy87;
+   goto yy4;
 yy4:
-#line 620
-   { return 0; }
+#line 621 /usr/src/php/php5/ext/standard/var_unserializer.re
+{ return 0; }
+#line 103 stdout
 yy5:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy81;
@@ -481,41 +486,49 @@
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy17;
goto yy4;
-yy14:  yych = *++YYCURSOR;
+yy14:  ++YYCURSOR;
+   goto yy15;
 yy15:
-#line 614
-   {
+#line 615 /usr/src/php/php5/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);
return 0; /* not sure if it should be 0 or 1 here? */
 }
+#line 148 stdout
 yy16:  yych = *++YYCURSOR;
goto yy4;
 yy17:  yych = *++YYCURSOR;
if(yybm[0+yych]  128)  goto yy19;
if(yych != '+') goto yy2;
+   goto yy18;
 yy18:  yych = *++YYCURSOR;
if(yybm[0+yych]  128)  goto yy19;
goto yy2;
 yy19:  ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
+   goto yy20;
 yy20:  if(yybm[0+yych]  128)  goto yy19;
if(yych != ':') goto yy2;
+   goto yy21;
 yy21:  yych = *++YYCURSOR;
if(yych != '') goto yy2;
-yy22:  yych = *++YYCURSOR;
+   goto yy22;
+yy22:  ++YYCURSOR;
+   goto yy23;
 yy23:
-#line 503
-   {
+#line 503 /usr/src/php/php5/ext/standard/var_unserializer.re
+{
size_t len, len2, len3, maxlen;
int elements;
char *class_name;
zend_class_entry *ce;
zend_class_entry **pce;
int incomplete_class = 0;
+
int custom_object = 0;
-/* */  
+
zval *user_func;
zval *retval_ptr;
zval **args[1];
@@ -617,9 +630,11 @@
 
return object_common2(UNSERIALIZE_PASSTHRU, elements);
 }
+#line 284 stdout
 yy24:  yych = *++YYCURSOR;
if(yych = ','){
if(yych != '+') goto yy2;
+   goto yy25;
} else {
if(yych = '-') goto yy25;
if(yych = '/') goto yy2;
@@ -629,24 +644,30 @@
 yy25:  yych = *++YYCURSOR;
if(yych = '/') goto yy2;
if(yych = ':') goto yy2;
+   goto yy26;
 yy26:  ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
+   goto yy27;
 yy27:  if(yych = '/') goto yy2;
if(yych = '9') goto yy26;
if(yych = ';') goto yy2;
+   goto yy28;
 yy28:  yych = *++YYCURSOR;
if(yych != '') goto yy2;
-yy29:  yych = *++YYCURSOR;
+   goto yy29;
+yy29:  ++YYCURSOR;
+   goto yy30;
 yy30:
-#line 495
-   {
+#line 495 /usr/src/php/php5/ext/standard/var_unserializer.re
+{
 
INIT_PZVAL(*rval);

return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, 
ZEND_STANDARD_CLASS_DEF_PTR));
 }
+#line 322 stdout
 yy31:  yych = *++YYCURSOR;
if(yych == '+') goto yy32;
if(yych = '/') goto yy2;
@@ -655,18 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2005-02-24 Thread Stanislav Malyshev
stasThu Feb 24 05:58:17 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.re var_unserializer.c 
  Log:
  fix typo
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.43r2=1.44ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.43 
php-src/ext/standard/var_unserializer.re:1.44
--- php-src/ext/standard/var_unserializer.re:1.43   Wed Feb 23 13:26:39 2005
+++ php-src/ext/standard/var_unserializer.reThu Feb 24 05:58:16 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.43 2005/02/23 18:26:39 sesser Exp $ */
+/* $Id: var_unserializer.re,v 1.44 2005/02/24 10:58:16 stas Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -295,7 +295,7 @@
(*p) += 2;
 
if(datalen  0 || (*p) + datalen = max) {
-   zend_error(E_WARNING, Unsifficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
+   zend_error(E_WARNING, Unsufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
return 0;
}

http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.55r2=1.56ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.55 
php-src/ext/standard/var_unserializer.c:1.56
--- php-src/ext/standard/var_unserializer.c:1.55Wed Feb 23 13:26:38 2005
+++ php-src/ext/standard/var_unserializer.c Thu Feb 24 05:58:16 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.55 2005/02/23 18:26:38 sesser Exp $ */
+/* $Id: var_unserializer.c,v 1.56 2005/02/24 10:58:16 stas Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -291,7 +291,7 @@
(*p) += 2;
 
if(datalen  0 || (*p) + datalen = max) {
-   zend_error(E_WARNING, Unsifficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
+   zend_error(E_WARNING, Unsufficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
return 0;
}


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2005-02-23 Thread Stefan Esser
sesser  Wed Feb 23 13:26:40 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Correcting bounds check before someone uses this code
  
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.54r2=1.55ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.54 
php-src/ext/standard/var_unserializer.c:1.55
--- php-src/ext/standard/var_unserializer.c:1.54Wed Feb 23 06:17:52 2005
+++ php-src/ext/standard/var_unserializer.c Wed Feb 23 13:26:38 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.54 2005/02/23 11:17:52 stas Exp $ */
+/* $Id: var_unserializer.c,v 1.55 2005/02/23 18:26:38 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -290,7 +290,7 @@
 
(*p) += 2;
 
-   if((*p) + datalen = max) {
+   if(datalen  0 || (*p) + datalen = max) {
zend_error(E_WARNING, Unsifficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
return 0;
}
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.42r2=1.43ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.42 
php-src/ext/standard/var_unserializer.re:1.43
--- php-src/ext/standard/var_unserializer.re:1.42   Wed Feb 23 06:17:52 2005
+++ php-src/ext/standard/var_unserializer.reWed Feb 23 13:26:39 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.42 2005/02/23 11:17:52 stas Exp $ */
+/* $Id: var_unserializer.re,v 1.43 2005/02/23 18:26:39 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -294,7 +294,7 @@
 
(*p) += 2;
 
-   if((*p) + datalen = max) {
+   if(datalen  0 || (*p) + datalen = max) {
zend_error(E_WARNING, Unsifficient data for unserializing - %d 
required, %d present, datalen, max - (*p));
return 0;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2005-02-14 Thread Marcus Boerger
helly   Mon Feb 14 16:03:12 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  - Disallow illegal class names (.c part)
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.52r2=1.53ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.52 
php-src/ext/standard/var_unserializer.c:1.53
--- php-src/ext/standard/var_unserializer.c:1.52Sun Jan 30 11:38:53 2005
+++ php-src/ext/standard/var_unserializer.c Mon Feb 14 16:03:09 2005
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.9.3 on Sun Jan 30 11:34:19 2005 */
-#line 1 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+/* Generated by re2c 0.9.4 on Mon Feb 14 21:57:21 2005 */
+#line 1 /usr/src/php-cvs/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 5|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.52 2005/01/30 16:38:53 iliaa Exp $ */
+/* $Id: var_unserializer.c,v 1.53 2005/02/14 21:03:09 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -147,7 +147,7 @@
 #define YYMARKER marker
 
 
-#line 154 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 154 /usr/src/php-cvs/ext/standard/var_unserializer.re
 
 
 
@@ -406,7 +406,7 @@
goto yy16;
} else {
if(yych = '}') goto yy14;
-   if(yych = '\277')  goto yy16;
+   if(yych = 0xBF)goto yy16;
goto yy2;
}
}
@@ -420,7 +420,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 574 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 581 /usr/src/php-cvs/ext/standard/var_unserializer.re
 { return 0; }
 #line 102 stdout
 yy5:   yyaccept = 0;
@@ -461,7 +461,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 568 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 575 /usr/src/php-cvs/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);
@@ -490,9 +490,9 @@
 yy22:  ++YYCURSOR;
goto yy23;
 yy23:
-#line 475 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 475 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
-   size_t len, len2, maxlen;
+   size_t len, len2, len3, maxlen;
int elements;
char *class_name;
zend_class_entry *ce;
@@ -525,6 +525,13 @@
return 0;
}
 
+   len3 = strspn(class_name, 
0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ);
+   if (len3 != len)
+   {
+   *p = YYCURSOR + len3 - len;
+   return 0;
+   }
+
class_name = estrndup(class_name, len);
 
do {
@@ -583,7 +590,7 @@
 
return object_common2(UNSERIALIZE_PASSTHRU, elements);
 }
-#line 264 stdout
+#line 271 stdout
 yy24:  yych = *++YYCURSOR;
if(yych = ','){
if(yych != '+') goto yy2;
@@ -612,7 +619,7 @@
 yy29:  ++YYCURSOR;
goto yy30;
 yy30:
-#line 467 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 467 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
 
INIT_PZVAL(*rval);
@@ -620,7 +627,7 @@
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, 
ZEND_STANDARD_CLASS_DEF_PTR));
 }
-#line 302 stdout
+#line 309 stdout
 yy31:  yych = *++YYCURSOR;
if(yych == '+') goto yy32;
if(yych = '/') goto yy2;
@@ -644,7 +651,7 @@
 yy36:  ++YYCURSOR;
goto yy37;
 yy37:
-#line 449 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 449 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
int elements = parse_iv(start + 2);
 
@@ -662,7 +669,7 @@
 
return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }
-#line 345 stdout
+#line 352 stdout
 yy38:  yych = *++YYCURSOR;
if(yych == '+') goto yy39;
if(yych = '/') goto yy2;
@@ -686,7 +693,7 @@
 yy43:  ++YYCURSOR;
goto yy44;
 yy44:
-#line 421 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 421 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
size_t len, maxlen;
char *str;
@@ -714,7 +721,7 @@
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
 }
-#line 398 stdout
+#line 405 stdout
 yy45:  yych = *++YYCURSOR;
if(yych = '/'){
if(yych = ','){
@@ -803,14 +810,14 @@
 yy55:  ++YYCURSOR;
goto yy56;
 yy56:
-#line 414 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 414 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2005-01-30 Thread Ilia Alshanetsky
iliaa   Sun Jan 30 11:38:54 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Fix handling of INF/NAN in unserialize().
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.51r2=1.52ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.51 
php-src/ext/standard/var_unserializer.c:1.52
--- php-src/ext/standard/var_unserializer.c:1.51Wed Jan 26 11:55:17 2005
+++ php-src/ext/standard/var_unserializer.c Sun Jan 30 11:38:53 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.3 on Wed Jan 26 11:09:50 2005 */
+/* Generated by re2c 0.9.3 on Sun Jan 30 11:34:19 2005 */
 #line 1 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.51 2005/01/26 16:55:17 iliaa Exp $ */
+/* $Id: var_unserializer.c,v 1.52 2005/01/30 16:38:53 iliaa Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -420,7 +420,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 576 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 574 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 { return 0; }
 #line 102 stdout
 yy5:   yyaccept = 0;
@@ -461,7 +461,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 570 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 568 /home/rei/php_dev/php5.1/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);
@@ -490,7 +490,7 @@
 yy22:  ++YYCURSOR;
goto yy23;
 yy23:
-#line 477 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 475 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
size_t len, len2, maxlen;
int elements;
@@ -612,7 +612,7 @@
 yy29:  ++YYCURSOR;
goto yy30;
 yy30:
-#line 469 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 467 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
 
INIT_PZVAL(*rval);
@@ -644,7 +644,7 @@
 yy36:  ++YYCURSOR;
goto yy37;
 yy37:
-#line 451 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 449 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
int elements = parse_iv(start + 2);
 
@@ -686,7 +686,7 @@
 yy43:  ++YYCURSOR;
goto yy44;
 yy44:
-#line 423 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 421 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
size_t len, maxlen;
char *str;
@@ -803,7 +803,7 @@
 yy55:  ++YYCURSOR;
goto yy56;
 yy56:
-#line 416 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 414 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -874,9 +874,7 @@
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
-#if defined(HAVE_ATOF_ACCEPTS_NAN)  defined(HAVE_ATOF_ACCEPTS_INF)
-   ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
-#else
+
if (!strncmp(start + 2, NAN, 3)) {
ZVAL_DOUBLE(*rval, php_get_nan());
} else if (!strncmp(start + 2, INF, 3)) {
@@ -884,10 +882,10 @@
} else if (!strncmp(start + 2, -INF, 4)) {
ZVAL_DOUBLE(*rval, -php_get_inf());
}
-#endif
+
return 1;
 }
-#line 575 stdout
+#line 573 stdout
 yy68:  yych = *++YYCURSOR;
if(yych == 'N') goto yy65;
goto yy2;
@@ -923,7 +921,7 @@
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
 }
-#line 612 stdout
+#line 610 stdout
 yy75:  yych = *++YYCURSOR;
if(yych = '/') goto yy2;
if(yych = '2') goto yy2;
@@ -941,7 +939,7 @@
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
 }
-#line 630 stdout
+#line 628 stdout
 yy79:  ++YYCURSOR;
goto yy80;
 yy80:
@@ -952,7 +950,7 @@
ZVAL_NULL(*rval);
return 1;
 }
-#line 641 stdout
+#line 639 stdout
 yy81:  yych = *++YYCURSOR;
if(yych = ','){
if(yych != '+') goto yy2;
@@ -1001,7 +999,7 @@

return 1;
 }
-#line 691 stdout
+#line 689 stdout
 yy87:  yych = *++YYCURSOR;
if(yych = ','){
if(yych != '+') goto yy2;
@@ -1048,9 +1046,9 @@

return 1;
 }
-#line 739 stdout
+#line 737 stdout
 }
-#line 578 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
+#line 576 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 
 
return 0;
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.39r2=1.40ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.39 
php-src/ext/standard/var_unserializer.re:1.40
--- 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2005-01-26 Thread Ilia Alshanetsky
iliaa   Wed Jan 26 11:55:17 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Fixed bug #31699 (unserialize() float problem on non-English locales).
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.50r2=1.51ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.50 
php-src/ext/standard/var_unserializer.c:1.51
--- php-src/ext/standard/var_unserializer.c:1.50Tue Jan 18 05:57:05 2005
+++ php-src/ext/standard/var_unserializer.c Wed Jan 26 11:55:17 2005
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.9.4 on Mon Sep 13 22:00:00 2004 */
-#line 1 /usr/src/php-cvs/ext/standard/var_unserializer.re
+/* Generated by re2c 0.9.3 on Wed Jan 26 11:09:50 2005 */
+#line 1 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 5|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.50 2005/01/18 10:57:05 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.51 2005/01/26 16:55:17 iliaa Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -125,7 +125,7 @@
efree(var_hash);
var_hash = next;
}
-   
+
var_hash = var_hashx-first_dtor;

while (var_hash) {
@@ -147,7 +147,7 @@
 #define YYMARKER marker
 
 
-#line 118 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 154 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 
 
 
@@ -406,7 +406,7 @@
goto yy16;
} else {
if(yych = '}') goto yy14;
-   if(yych = 0xBF)goto yy16;
+   if(yych = '\277')  goto yy16;
goto yy2;
}
}
@@ -420,7 +420,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 532 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 576 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 { return 0; }
 #line 102 stdout
 yy5:   yyaccept = 0;
@@ -461,7 +461,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 526 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 570 /home/rei/php_dev/php5.1/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);
@@ -490,7 +490,7 @@
 yy22:  ++YYCURSOR;
goto yy23;
 yy23:
-#line 433 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 477 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
size_t len, len2, maxlen;
int elements;
@@ -612,7 +612,7 @@
 yy29:  ++YYCURSOR;
goto yy30;
 yy30:
-#line 425 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 469 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
 
INIT_PZVAL(*rval);
@@ -644,7 +644,7 @@
 yy36:  ++YYCURSOR;
goto yy37;
 yy37:
-#line 407 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 451 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
int elements = parse_iv(start + 2);
 
@@ -686,7 +686,7 @@
 yy43:  ++YYCURSOR;
goto yy44;
 yy44:
-#line 379 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 423 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
size_t len, maxlen;
char *str;
@@ -803,11 +803,11 @@
 yy55:  ++YYCURSOR;
goto yy56;
 yy56:
-#line 372 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 416 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
-   ZVAL_DOUBLE(*rval, atof(start + 2));
+   ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
return 1;
 }
 #line 496 stdout
@@ -870,12 +870,12 @@
 yy66:  ++YYCURSOR;
goto yy67;
 yy67:
-#line 355 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 399 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
 #if defined(HAVE_ATOF_ACCEPTS_NAN)  defined(HAVE_ATOF_ACCEPTS_INF)
-   ZVAL_DOUBLE(*rval, atof(start + 2));
+   ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
 #else
if (!strncmp(start + 2, NAN, 3)) {
ZVAL_DOUBLE(*rval, php_get_nan());
@@ -916,7 +916,7 @@
 yy73:  ++YYCURSOR;
goto yy74;
 yy74:
-#line 348 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 392 /home/rei/php_dev/php5.1/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -934,7 +934,7 @@
 yy77:  ++YYCURSOR;
goto yy78;
 yy78:
-#line 341 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 385 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2005-01-17 Thread Stefan Esser
sesser  Mon Jan 17 06:45:09 2005 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Fix compiler warning.
  
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.48r2=1.49ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.48 
php-src/ext/standard/var_unserializer.c:1.49
--- php-src/ext/standard/var_unserializer.c:1.48Sat Jan 15 13:30:16 2005
+++ php-src/ext/standard/var_unserializer.c Mon Jan 17 06:45:09 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.48 2005/01/15 18:30:16 sesser Exp $ */
+/* $Id: var_unserializer.c,v 1.49 2005/01/17 11:45:09 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -213,7 +213,7 @@
 static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, 
int elements)
 {
while (elements--  0) {
-   zval *key, *data, *old_data;
+   zval *key, *data, **old_data;
 
ALLOC_INIT_ZVAL(key);
 
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.37r2=1.38ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.37 
php-src/ext/standard/var_unserializer.re:1.38
--- php-src/ext/standard/var_unserializer.re:1.37   Sat Jan 15 13:30:16 2005
+++ php-src/ext/standard/var_unserializer.reMon Jan 17 06:45:09 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.37 2005/01/15 18:30:16 sesser Exp $ */
+/* $Id: var_unserializer.re,v 1.38 2005/01/17 11:45:09 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -216,7 +216,7 @@
 static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, 
int elements)
 {
while (elements--  0) {
-   zval *key, *data, *old_data;
+   zval *key, *data, **old_data;
 
ALLOC_INIT_ZVAL(key);
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2005-01-16 Thread Jon Parise
On Sat, Jan 15, 2005 at 06:30:17PM -, Stefan Esser wrote:

 sesserSat Jan 15 13:30:17 2005 EDT
 
   Modified files:  
 /php-src/ext/standard var_unserializer.c var_unserializer.re 
   Log:
   and use it...

Use what?

See, I get that I need to look backwards in the mailing list archive
to establish context, but 'cvs log var_unserializer.c' won't give me
any useful information for this atomic change.

Please be more descriptive in the future.

-- 
Jon Parise (jon of php.net) :: The PHP Project (http://www.php.net/)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2004-12-04 Thread Marcus Boerger
Hello Stefan,

  reading the patch twice and checking the code again. Why not simply
replace the index type 'iv' with 'uiv' ?

R: iv ;   - R: uiv ;
r: iv ;   - r: uiv ;

marcus

Wednesday, December 1, 2004, 11:42:00 PM, you wrote:

 sesser  Wed Dec  1 17:42:00 2004 EDT

   Modified files:  
 /php-src/ext/standard   var_unserializer.c var_unserializer.re 
   Log:
   Beware of negative indices
  
  
  
 http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.44r2=1.45ty=u
 Index: php-src/ext/standard/var_unserializer.c
 diff -u php-src/ext/standard/var_unserializer.c:1.44
 php-src/ext/standard/var_unserializer.c:1.45
 --- php-src/ext/standard/var_unserializer.c:1.44Sun Sep 26 17:49:16 
 2004
 +++ php-src/ext/standard/var_unserializer.c Wed Dec  1 17:42:00 2004
 @@ -18,7 +18,7 @@
   
 +--+
  */
 
 -/* $Id: var_unserializer.c,v 1.44 2004/09/26 21:49:16 helly Exp $ */
 +/* $Id: var_unserializer.c,v 1.45 2004/12/01 22:42:00 sesser Exp $ */
 
  #include php.h
  #include ext/standard/php_var.h
 @@ -83,7 +83,7 @@
 
 if (!var_hash) return !SUCCESS;
 
 -   if (id = var_hash-used_slots) return !SUCCESS;
 +   if (id  0 || id = var_hash-used_slots) return !SUCCESS;
 
 *store = var_hash-data[id];
 
 http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.33r2=1.34ty=u
 Index: php-src/ext/standard/var_unserializer.re
 diff -u php-src/ext/standard/var_unserializer.re:1.33
 php-src/ext/standard/var_unserializer.re:1.34
 --- php-src/ext/standard/var_unserializer.re:1.33   Sun Sep 26 17:47:27 
 2004
 +++ php-src/ext/standard/var_unserializer.reWed Dec  1 17:42:00 2004
 @@ -16,7 +16,7 @@
   
 +--+
  */
 
 -/* $Id: var_unserializer.re,v 1.33 2004/09/26 21:47:27 helly Exp $ */
 +/* $Id: var_unserializer.re,v 1.34 2004/12/01 22:42:00 sesser Exp $ */
 
  #include php.h
  #include ext/standard/php_var.h
 @@ -81,7 +81,7 @@
 
 if (!var_hash) return !SUCCESS;
 
 -   if (id = var_hash-used_slots) return !SUCCESS;
 +   if (id  0 || id = var_hash-used_slots) return !SUCCESS;
 
 *store = var_hash-data[id];
 




-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2004-12-04 Thread Stefan Esser
Marcus Boerger wrote:
Hello Stefan,
  reading the patch twice and checking the code again. Why not simply
replace the index type 'iv' with 'uiv' ?
R: iv ;   - R: uiv ;
r: iv ;   - r: uiv ;
Because that would not fix anything. Both functions do not check for 
integer overflows when generating the number. So any positive number 
above 2^31 will be negative when casted to int.

Stefan
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2004-12-04 Thread Marcus Boerger
Hello Stefan,

Saturday, December 4, 2004, 12:49:19 PM, you wrote:

 Marcus Boerger wrote:
 Hello Stefan,
 
   reading the patch twice and checking the code again. Why not simply
 replace the index type 'iv' with 'uiv' ?
 
 R: iv ;   - R: uiv ;
 r: iv ;   - r: uiv ;

 Because that would not fix anything. Both functions do not check for 
 integer overflows when generating the number. So any positive number 
 above 2^31 will be negative when casted to int.

Ic, in that case iv-uiv is still a good idea and the first check
shouldn't be
if (id == -1 || var_access...
but
if (id  0 || var_access...
. And as a result of those problems we may need to verify the
values generated with parse_iv() and parse_uiv().

regards
marcus




-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2004-12-03 Thread Stefan Esser
sesser  Fri Dec  3 11:02:48 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Handle already existing elements correctly
  
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.45r2=1.46ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.45 
php-src/ext/standard/var_unserializer.c:1.46
--- php-src/ext/standard/var_unserializer.c:1.45Wed Dec  1 17:42:00 2004
+++ php-src/ext/standard/var_unserializer.c Fri Dec  3 11:02:48 2004
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.45 2004/12/01 22:42:00 sesser Exp $ */
+/* $Id: var_unserializer.c,v 1.46 2004/12/03 16:02:48 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -65,7 +65,7 @@
for (i = 0; i  var_hash-used_slots; i++) {
if (var_hash-data[i] == ozval) {
var_hash-data[i] = *nzval;
-   return;
+   /* do not break here */
}
}
var_hash = var_hash-next;
@@ -177,7 +177,7 @@
 static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, 
int elements)
 {
while (elements--  0) {
-   zval *key, *data;
+   zval *key, *data, *old_data;
 
ALLOC_INIT_ZVAL(key);
 
@@ -205,9 +205,15 @@
 
switch (Z_TYPE_P(key)) {
case IS_LONG:
+   if (zend_hash_index_find(ht, Z_LVAL_P(key), 
(void **)old_data)) {
+   var_replace(var_hash, old_data, rval);
+   }
zend_hash_index_update(ht, Z_LVAL_P(key), 
data, sizeof(data), NULL);
break;
case IS_STRING:
+   if (zend_hash_find(ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, (void **)old_data)) {
+   var_replace(var_hash, old_data, rval);
+   }
zend_hash_update(ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, data, sizeof(data), NULL);
break;
}
@@ -947,6 +953,8 @@
if (id == -1 || var_access(var_hash, id, rval_ref) != SUCCESS) {
return 0;
}
+   
+   if (*rval == *rval_ref) return 0;
 
if (*rval != NULL) {
zval_ptr_dtor(rval);
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.34r2=1.35ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.34 
php-src/ext/standard/var_unserializer.re:1.35
--- php-src/ext/standard/var_unserializer.re:1.34   Wed Dec  1 17:42:00 2004
+++ php-src/ext/standard/var_unserializer.reFri Dec  3 11:02:48 2004
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.34 2004/12/01 22:42:00 sesser Exp $ */
+/* $Id: var_unserializer.re,v 1.35 2004/12/03 16:02:48 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -63,7 +63,7 @@
for (i = 0; i  var_hash-used_slots; i++) {
if (var_hash-data[i] == ozval) {
var_hash-data[i] = *nzval;
-   return;
+   /* do not break here */
}
}
var_hash = var_hash-next;
@@ -180,7 +180,7 @@
 static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, 
int elements)
 {
while (elements--  0) {
-   zval *key, *data;
+   zval *key, *data, *old_data;
 
ALLOC_INIT_ZVAL(key);
 
@@ -208,9 +208,15 @@
 
switch (Z_TYPE_P(key)) {
case IS_LONG:
+   if (zend_hash_index_find(ht, Z_LVAL_P(key), 
(void **)old_data)) {
+   var_replace(var_hash, old_data, rval);
+   }
zend_hash_index_update(ht, Z_LVAL_P(key), 
data, sizeof(data), NULL);
break;
case IS_STRING:
+   if (zend_hash_find(ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, (void **)old_data)) {
+   var_replace(var_hash, old_data, rval);
+   }
zend_hash_update(ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, data, sizeof(data), NULL);
break;
}
@@ -321,6 +327,8 @@
return 0;
}
 
+   if (*rval == 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2004-12-01 Thread Stefan Esser
sesser  Wed Dec  1 17:42:00 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Beware of negative indices
  
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.44r2=1.45ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.44 
php-src/ext/standard/var_unserializer.c:1.45
--- php-src/ext/standard/var_unserializer.c:1.44Sun Sep 26 17:49:16 2004
+++ php-src/ext/standard/var_unserializer.c Wed Dec  1 17:42:00 2004
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.44 2004/09/26 21:49:16 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.45 2004/12/01 22:42:00 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -83,7 +83,7 @@
 
if (!var_hash) return !SUCCESS;
 
-   if (id = var_hash-used_slots) return !SUCCESS;
+   if (id  0 || id = var_hash-used_slots) return !SUCCESS;
 
*store = var_hash-data[id];
 
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.33r2=1.34ty=u
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.33 
php-src/ext/standard/var_unserializer.re:1.34
--- php-src/ext/standard/var_unserializer.re:1.33   Sun Sep 26 17:47:27 2004
+++ php-src/ext/standard/var_unserializer.reWed Dec  1 17:42:00 2004
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.33 2004/09/26 21:47:27 helly Exp $ */
+/* $Id: var_unserializer.re,v 1.34 2004/12/01 22:42:00 sesser Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -81,7 +81,7 @@
 
if (!var_hash) return !SUCCESS;
 
-   if (id = var_hash-used_slots) return !SUCCESS;
+   if (id  0 || id = var_hash-used_slots) return !SUCCESS;
 
*store = var_hash-data[id];
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2004-12-01 Thread Marcus Boerger
Hello Stefan,

 good catch :-)

Wednesday, December 1, 2004, 11:42:00 PM, you wrote:

 sesser  Wed Dec  1 17:42:00 2004 EDT

   Modified files:  
 /php-src/ext/standard   var_unserializer.c var_unserializer.re 
   Log:
   Beware of negative indices
  
  
  
 http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.44r2=1.45ty=u
 Index: php-src/ext/standard/var_unserializer.c
 diff -u php-src/ext/standard/var_unserializer.c:1.44
 php-src/ext/standard/var_unserializer.c:1.45
 --- php-src/ext/standard/var_unserializer.c:1.44Sun Sep 26 17:49:16 
 2004
 +++ php-src/ext/standard/var_unserializer.c Wed Dec  1 17:42:00 2004
 @@ -18,7 +18,7 @@
   
 +--+
  */
 
 -/* $Id: var_unserializer.c,v 1.44 2004/09/26 21:49:16 helly Exp $ */
 +/* $Id: var_unserializer.c,v 1.45 2004/12/01 22:42:00 sesser Exp $ */
 
  #include php.h
  #include ext/standard/php_var.h
 @@ -83,7 +83,7 @@
 
 if (!var_hash) return !SUCCESS;
 
 -   if (id = var_hash-used_slots) return !SUCCESS;
 +   if (id  0 || id = var_hash-used_slots) return !SUCCESS;
 
 *store = var_hash-data[id];
 
 http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.33r2=1.34ty=u
 Index: php-src/ext/standard/var_unserializer.re
 diff -u php-src/ext/standard/var_unserializer.re:1.33
 php-src/ext/standard/var_unserializer.re:1.34
 --- php-src/ext/standard/var_unserializer.re:1.33   Sun Sep 26 17:47:27 
 2004
 +++ php-src/ext/standard/var_unserializer.reWed Dec  1 17:42:00 2004
 @@ -16,7 +16,7 @@
   
 +--+
  */
 
 -/* $Id: var_unserializer.re,v 1.33 2004/09/26 21:47:27 helly Exp $ */
 +/* $Id: var_unserializer.re,v 1.34 2004/12/01 22:42:00 sesser Exp $ */
 
  #include php.h
  #include ext/standard/php_var.h
 @@ -81,7 +81,7 @@
 
 if (!var_hash) return !SUCCESS;
 
 -   if (id = var_hash-used_slots) return !SUCCESS;
 +   if (id  0 || id = var_hash-used_slots) return !SUCCESS;
 
 *store = var_hash-data[id];
 




-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2004-09-26 Thread Marcus Boerger
helly   Sun Sep 26 17:49:16 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  - Earlier detection of failure (.c now)
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.43r2=1.44ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.43 
php-src/ext/standard/var_unserializer.c:1.44
--- php-src/ext/standard/var_unserializer.c:1.43Sun Sep 12 08:45:01 2004
+++ php-src/ext/standard/var_unserializer.c Sun Sep 26 17:49:16 2004
@@ -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
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.43 2004/09/12 12:45:01 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.44 2004/09/26 21:49:16 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -187,6 +187,12 @@
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 @@
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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2004-09-12 Thread Marcus Boerger
helly   Sun Sep 12 07:51:13 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  - Remove wrong test
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.41r2=1.42ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.41 
php-src/ext/standard/var_unserializer.c:1.42
--- php-src/ext/standard/var_unserializer.c:1.41Sun Sep  5 13:44:15 2004
+++ php-src/ext/standard/var_unserializer.c Sun Sep 12 07:51:13 2004
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Sun Sep  5 19:19:02 2004 */
+/* Generated by re2c 0.9.4 on Sun Sep 12 13:42:52 2004 */
 #line 1 /usr/src/php-cvs/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.41 2004/09/05 17:44:15 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.42 2004/09/12 11:51:13 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -209,14 +209,6 @@

zval_dtor(key);
FREE_ZVAL(key);
-   
-   if (elements  *(*p-1) != ';') {
-#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE
-   zval_ptr_dtor(rval);
-#endif
-   (*p)--;
-   return 0;
-   }
}
 
return 1;
@@ -376,7 +368,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 530 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 522 /usr/src/php-cvs/ext/standard/var_unserializer.re
 { return 0; }
 #line 102 stdout
 yy5:   yyaccept = 0;
@@ -417,7 +409,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 524 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 516 /usr/src/php-cvs/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);
@@ -446,7 +438,7 @@
 yy22:  ++YYCURSOR;
goto yy23;
 yy23:
-#line 431 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 423 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
size_t len, len2, maxlen;
int elements;
@@ -568,7 +560,7 @@
 yy29:  ++YYCURSOR;
goto yy30;
 yy30:
-#line 423 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 415 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
 
INIT_PZVAL(*rval);
@@ -600,7 +592,7 @@
 yy36:  ++YYCURSOR;
goto yy37;
 yy37:
-#line 405 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 397 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
int elements = parse_iv(start + 2);
 
@@ -642,7 +634,7 @@
 yy43:  ++YYCURSOR;
goto yy44;
 yy44:
-#line 377 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 369 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
size_t len, maxlen;
char *str;
@@ -759,7 +751,7 @@
 yy55:  ++YYCURSOR;
goto yy56;
 yy56:
-#line 370 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 362 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -826,7 +818,7 @@
 yy66:  ++YYCURSOR;
goto yy67;
 yy67:
-#line 353 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 345 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -872,7 +864,7 @@
 yy73:  ++YYCURSOR;
goto yy74;
 yy74:
-#line 346 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 338 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -890,7 +882,7 @@
 yy77:  ++YYCURSOR;
goto yy78;
 yy78:
-#line 339 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 331 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -901,7 +893,7 @@
 yy79:  ++YYCURSOR;
goto yy80;
 yy80:
-#line 332 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 324 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -934,7 +926,7 @@
 yy85:  ++YYCURSOR;
goto yy86;
 yy86:
-#line 311 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 303 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
int id;
 
@@ -981,7 +973,7 @@
 yy91:  ++YYCURSOR;
goto yy92;
 yy92:
-#line 290 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 282 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
int id;
 
@@ -1004,7 +996,7 @@
 }
 #line 737 stdout
 }
-#line 532 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 524 /usr/src/php-cvs/ext/standard/var_unserializer.re
 
 
return 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2004-09-12 Thread Marcus Boerger
helly   Sun Sep 12 08:45:01 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  - Moe changed from .re to .c
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.42r2=1.43ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.42 
php-src/ext/standard/var_unserializer.c:1.43
--- php-src/ext/standard/var_unserializer.c:1.42Sun Sep 12 07:51:13 2004
+++ php-src/ext/standard/var_unserializer.c Sun Sep 12 08:45:01 2004
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Sun Sep 12 13:42:52 2004 */
+/* Generated by re2c 0.9.4 on Sun Sep 12 14:43:48 2004 */
 #line 1 /usr/src/php-cvs/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.42 2004/09/12 11:51:13 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.43 2004/09/12 12:45:01 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -204,11 +204,21 @@
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);
FREE_ZVAL(key);
+
+   if (elements  *(*p-1) != ';'   *(*p-1) != '}') {
+   (*p)--;
+   return 0;
+   }
}
 
return 1;
@@ -368,7 +378,7 @@
if(yych == ':') goto yy87;
goto yy4;
 yy4:
-#line 522 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 532 /usr/src/php-cvs/ext/standard/var_unserializer.re
 { return 0; }
 #line 102 stdout
 yy5:   yyaccept = 0;
@@ -409,7 +419,7 @@
 yy14:  ++YYCURSOR;
goto yy15;
 yy15:
-#line 516 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 526 /usr/src/php-cvs/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);
@@ -438,7 +448,7 @@
 yy22:  ++YYCURSOR;
goto yy23;
 yy23:
-#line 423 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 433 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
size_t len, len2, maxlen;
int elements;
@@ -560,7 +570,7 @@
 yy29:  ++YYCURSOR;
goto yy30;
 yy30:
-#line 415 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 425 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
 
INIT_PZVAL(*rval);
@@ -592,7 +602,7 @@
 yy36:  ++YYCURSOR;
goto yy37;
 yy37:
-#line 397 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 407 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
int elements = parse_iv(start + 2);
 
@@ -634,7 +644,7 @@
 yy43:  ++YYCURSOR;
goto yy44;
 yy44:
-#line 369 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 379 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
size_t len, maxlen;
char *str;
@@ -751,7 +761,7 @@
 yy55:  ++YYCURSOR;
goto yy56;
 yy56:
-#line 362 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 372 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -818,7 +828,7 @@
 yy66:  ++YYCURSOR;
goto yy67;
 yy67:
-#line 345 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 355 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -864,7 +874,7 @@
 yy73:  ++YYCURSOR;
goto yy74;
 yy74:
-#line 338 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 348 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -882,7 +892,7 @@
 yy77:  ++YYCURSOR;
goto yy78;
 yy78:
-#line 331 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 341 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -893,7 +903,7 @@
 yy79:  ++YYCURSOR;
goto yy80;
 yy80:
-#line 324 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 334 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -926,7 +936,7 @@
 yy85:  ++YYCURSOR;
goto yy86;
 yy86:
-#line 303 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 313 /usr/src/php-cvs/ext/standard/var_unserializer.re
 {
int id;
 
@@ -973,7 +983,7 @@
 yy91:  ++YYCURSOR;
goto yy92;
 yy92:
-#line 282 /usr/src/php-cvs/ext/standard/var_unserializer.re
+#line 292 

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2004-09-05 Thread Marcus Boerger
helly   Sun Sep  5 13:44:15 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  Touch
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.40r2=1.41ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.40 
php-src/ext/standard/var_unserializer.c:1.41
--- php-src/ext/standard/var_unserializer.c:1.40Sun Sep  5 12:29:04 2004
+++ php-src/ext/standard/var_unserializer.c Sun Sep  5 13:44:15 2004
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Thu Sep  2 20:41:03 2004 */
+/* Generated by re2c 0.9.4 on Sun Sep  5 19:19:02 2004 */
 #line 1 /usr/src/php-cvs/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.40 2004/09/05 16:29:04 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.41 2004/09/05 17:44:15 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2004-03-23 Thread Marcus Boerger
helly   Tue Mar 23 17:33:29 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  Update .c output after .re
  http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.36r2=1.37ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.36 
php-src/ext/standard/var_unserializer.c:1.37
--- php-src/ext/standard/var_unserializer.c:1.36Tue Mar 23 15:54:00 2004
+++ php-src/ext/standard/var_unserializer.c Tue Mar 23 17:33:29 2004
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.2 on Tue Mar 23 21:48:54 2004 */
+/* Generated by re2c 0.9.2 on Tue Mar 23 23:12:19 2004 */
 #line 1 /usr/src/php5/ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.36 2004/03/23 20:54:00 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.37 2004/03/23 22:33:29 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -294,7 +294,7 @@
goto yy0;
 yy1:   ++YYCURSOR;
 yy0:
-   if((YYLIMIT - YYCURSOR)  6) YYFILL(6);
+   if((YYLIMIT - YYCURSOR)  7) YYFILL(7);
yych = *YYCURSOR;
if(yych = 'd'){
if(yych = 'R'){
@@ -343,7 +343,7 @@
}
 yy3:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
-   if(yych == ':') goto yy86;
+   if(yych == ':') goto yy87;
goto yy4;
 yy4:
 #line 461 /usr/src/php5/ext/standard/var_unserializer.re
@@ -351,18 +351,18 @@
 #line 102 re2c-output.c
 yy5:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
-   if(yych == ':') goto yy80;
+   if(yych == ':') goto yy81;
goto yy4;
 yy6:   yych = *++YYCURSOR;
-   if(yych == ';') goto yy78;
+   if(yych == ';') goto yy79;
goto yy4;
 yy7:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
-   if(yych == ':') goto yy72;
+   if(yych == ':') goto yy73;
goto yy4;
 yy8:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
-   if(yych == ':') goto yy66;
+   if(yych == ':') goto yy67;
goto yy4;
 yy9:   yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -625,67 +625,76 @@
if(yych != '+') goto yy2;
goto yy46;
} else {
-   if(yych = '-') goto yy46;
-   if(yych = '.') goto yy49;
+   if(yych = '-') goto yy47;
+   if(yych = '.') goto yy50;
goto yy2;
}
} else {
if(yych = 'I'){
-   if(yych = '9') goto yy47;
+   if(yych = '9') goto yy48;
if(yych = 'H') goto yy2;
-   goto yy51;
+   goto yy52;
} else {
-   if(yych == 'N') goto yy50;
+   if(yych == 'N') goto yy51;
goto yy2;
}
}
 yy46:  yych = *++YYCURSOR;
-   if(yych == '.') goto yy49;
+   if(yych == '.') goto yy50;
if(yych = '/') goto yy2;
-   if(yych = ':') goto yy2;
-   goto yy47;
-yy47:  ++YYCURSOR;
+   if(yych = '9') goto yy48;
+   goto yy2;
+yy47:  yych = *++YYCURSOR;
+   if(yych = '/'){
+   if(yych == '.') goto yy50;
+   goto yy2;
+   } else {
+   if(yych = '9') goto yy48;
+   if(yych == 'I') goto yy52;
+   goto yy2;
+   }
+yy48:  ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
-   goto yy48;
-yy48:  if(yych = ':'){
+   goto yy49;
+yy49:  if(yych = ':'){
if(yych = '.'){
if(yych = '-') goto yy2;
-   goto yy64;
+   goto yy65;
} else {
if(yych = '/') goto yy2;
-   if(yych = '9') goto yy47;
+   if(yych = '9') goto yy48;
goto yy2;
}
} else {
if(yych = 'E'){
-   if(yych = ';') goto yy54;
+   if(yych = ';') goto yy55;
if(yych = 'D') goto yy2;
-   goto yy59;
+   goto yy60;
} else {
-   if(yych == 'e') goto yy59;
+   if(yych == 'e') goto yy60;
goto yy2;
}
}
-yy49:  yych = *++YYCURSOR;
-   if(yych = '/') goto yy2;
-   if(yych = '9') goto yy57;
-   goto yy2;
 yy50:  yych = *++YYCURSOR;
-   if(yych == 'A') goto yy56;
+   if(yych = '/') goto yy2;
+   if(yych = '9') goto yy58;
goto yy2;
 yy51:  yych = *++YYCURSOR;
-   if(yych != 'N') goto yy2;
-   goto yy52;
+   

[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2004-02-03 Thread Jani Taskinen
sniper  Tue Feb  3 10:50:22 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  touch
  
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.34r2=1.35ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.34 
php-src/ext/standard/var_unserializer.c:1.35
--- php-src/ext/standard/var_unserializer.c:1.34Tue Feb  3 09:12:59 2004
+++ php-src/ext/standard/var_unserializer.c Tue Feb  3 10:50:21 2004
@@ -1,6 +1,6 @@
 /* Generated by re2c 0.5 on Tue Feb  3 16:01:43 2004 */
 #line 1 var_unserializer.re
-/*
+/* 
   +--+
   | PHP Version 5|
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.34 2004/02/03 14:12:59 stas Exp $ */
+/* $Id: var_unserializer.c,v 1.35 2004/02/03 15:50:21 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2004-01-01 Thread Marcus Boerger
helly   Thu Jan  1 22:27:33 2004 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  Bugfix #26762 unserialize() produces lowercase classnames
  
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.30 
php-src/ext/standard/var_unserializer.c:1.31
--- php-src/ext/standard/var_unserializer.c:1.30Wed Sep  3 12:24:24 2003
+++ php-src/ext/standard/var_unserializer.c Thu Jan  1 22:27:32 2004
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Wed Sep  3 19:23:11 2003 */
-#line 1 /usr/src/web/php/php5/ext/standard/var_unserializer.re
+/* Generated by re2c 0.5 on Fri Jan  2 04:02:19 2004 */
+#line 1 /usr/src/php5/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 4|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.30 2003/09/03 16:24:24 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.31 2004/01/02 03:27:32 helly Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -341,7 +341,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy74;
 yy4:
-#line 446
+#line 440
{ return 0; }
 yy5:   yych = *++YYCURSOR;
if(yych == ';') goto yy72;
@@ -376,7 +376,7 @@
goto yy4;
 yy13:  yych = *++YYCURSOR;
 yy14:
-#line 440
+#line 434
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of serialized 
data);
@@ -422,12 +422,6 @@
class_name = estrndup(YYCURSOR, len);
YYCURSOR += len;
 
-   while (len--  0) {
-   if (class_name[len] = 'A'  class_name[len] = 'Z') {
-   class_name[len] = class_name[len] - 'A' + 'a';
-   }
-   }
-   
do {
/* Try to find class directly */
if (zend_lookup_class(class_name, len2, pce TSRMLS_CC) == SUCCESS) {
@@ -803,7 +797,7 @@
return 1;
 }
 }
-#line 448
+#line 442
 
 
return 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2003-09-03 Thread Jani Taskinen
sniper  Wed Sep  3 12:24:25 2003 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  sync
  
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.29 
php-src/ext/standard/var_unserializer.c:1.30
--- php-src/ext/standard/var_unserializer.c:1.29Tue Aug  5 05:23:17 2003
+++ php-src/ext/standard/var_unserializer.c Wed Sep  3 12:24:24 2003
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Tue Aug  5 12:19:02 2003 */
-#line 1 /home/frodo/php5/ext/standard/var_unserializer.re
+/* Generated by re2c 0.5 on Wed Sep  3 19:23:11 2003 */
+#line 1 /usr/src/web/php/php5/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 4|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.29 2003/08/05 09:23:17 stas Exp $ */
+/* $Id: var_unserializer.c,v 1.30 2003/09/03 16:24:24 sniper Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -111,7 +111,7 @@
 #define YYMARKER marker
 
 
-#line 117
+#line 118
 
 
 
@@ -341,7 +341,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy74;
 yy4:
-#line 445
+#line 446
{ return 0; }
 yy5:   yych = *++YYCURSOR;
if(yych == ';') goto yy72;
@@ -376,7 +376,7 @@
goto yy4;
 yy13:  yych = *++YYCURSOR;
 yy14:
-#line 439
+#line 440
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of serialized 
data);
@@ -386,8 +386,7 @@
goto yy4;
 yy16:  yych = *++YYCURSOR;
if(yybm[0+yych]  128)  goto yy18;
-   if(yych == '+') goto yy17;
-   if(yych != '-') goto yy2;
+   if(yych != '+') goto yy2;
 yy17:  yych = *++YYCURSOR;
if(yybm[0+yych]  128)  goto yy18;
goto yy2;
@@ -400,7 +399,7 @@
if(yych != '') goto yy2;
 yy21:  yych = *++YYCURSOR;
 yy22:
-#line 354
+#line 355
{
int len;
int elements;
@@ -507,7 +506,7 @@
if(yych != '') goto yy2;
 yy28:  yych = *++YYCURSOR;
 yy29:
-#line 346
+#line 347
{
 
INIT_PZVAL(*rval);
@@ -516,14 +515,10 @@
object_common1(UNSERIALIZE_PASSTHRU, 
ZEND_STANDARD_CLASS_DEF_PTR));
 }
 yy30:  yych = *++YYCURSOR;
-   if(yych = ','){
-   if(yych != '+') goto yy2;
-   } else {
-   if(yych = '-') goto yy31;
-   if(yych = '/') goto yy2;
-   if(yych = '9') goto yy32;
-   goto yy2;
-   }
+   if(yych == '+') goto yy31;
+   if(yych = '/') goto yy2;
+   if(yych = '9') goto yy32;
+   goto yy2;
 yy31:  yych = *++YYCURSOR;
if(yych = '/') goto yy2;
if(yych = ':') goto yy2;
@@ -537,7 +532,7 @@
if(yych != '{') goto yy2;
 yy35:  yych = *++YYCURSOR;
 yy36:
-#line 328
+#line 329
{
int elements = parse_iv(start + 2);
 
@@ -556,14 +551,10 @@
return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }
 yy37:  yych = *++YYCURSOR;
-   if(yych = ','){
-   if(yych != '+') goto yy2;
-   } else {
-   if(yych = '-') goto yy38;
-   if(yych = '/') goto yy2;
-   if(yych = '9') goto yy39;
-   goto yy2;
-   }
+   if(yych == '+') goto yy38;
+   if(yych = '/') goto yy2;
+   if(yych = '9') goto yy39;
+   goto yy2;
 yy38:  yych = *++YYCURSOR;
if(yych = '/') goto yy2;
if(yych = ':') goto yy2;
@@ -577,7 +568,7 @@
if(yych != '') goto yy2;
 yy42:  yych = *++YYCURSOR;
 yy43:
-#line 308
+#line 309
{
int len;
char *str;
@@ -654,7 +645,7 @@
}
 yy51:  yych = *++YYCURSOR;
 yy52:
-#line 301
+#line 302
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -727,7 +718,7 @@
if(yych != ';') goto yy2;
 yy64:  yych = *++YYCURSOR;
 yy65:
-#line 294
+#line 295
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -754,7 +745,7 @@
if(yych != ';') goto yy2;
 yy70:  yych = *++YYCURSOR;
 yy71:
-#line 287
+#line 288
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -763,7 +754,7 @@
 }
 yy72:  yych = *++YYCURSOR;
 yy73:
-#line 280
+#line 281
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -790,7 +781,7 @@
if(yych != ';') goto yy2;
 yy78:  yych = *++YYCURSOR;
 yy79:
-#line 259
+#line 260
{
int id;
 
@@ -812,7 +803,7 @@
return 1;
 }
 }
-#line 447
+#line 448
 
 
return 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2003-08-11 Thread Stanislav Malyshev
stasTue Aug  5 05:23:17 2003 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  syncronize
  
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.28 
php-src/ext/standard/var_unserializer.c:1.29
--- php-src/ext/standard/var_unserializer.c:1.28Wed Jul  2 12:19:57 2003
+++ php-src/ext/standard/var_unserializer.c Tue Aug  5 05:23:17 2003
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Thu Jul  3 01:22:57 2003 */
-#line 1 /home/koizumi/src/php-src-5/ext/standard/var_unserializer.re
+/* Generated by re2c 0.5 on Tue Aug  5 12:19:02 2003 */
+#line 1 /home/frodo/php5/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 4|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.28 2003/07/02 16:19:57 moriyoshi Exp $ */
+/* $Id: var_unserializer.c,v 1.29 2003/08/05 09:23:17 stas Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -224,9 +224,11 @@
return 0;
}
 
-   INIT_PZVAL(fname);
-   ZVAL_STRINGL(fname, __wakeup, sizeof(__wakeup) - 1, 0);
-   call_user_function_ex(CG(function_table), rval, fname, retval_ptr, 0, 0, 1, 
NULL TSRMLS_CC);
+   if(Z_OBJCE_PP(rval) != PHP_IC_ENTRY) {
+   INIT_PZVAL(fname);
+   ZVAL_STRINGL(fname, __wakeup, sizeof(__wakeup) - 1, 0);
+   call_user_function_ex(CG(function_table), rval, fname, retval_ptr, 
0, 0, 1, NULL TSRMLS_CC);
+   }
 
if (retval_ptr)
zval_ptr_dtor(retval_ptr);
@@ -339,7 +341,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy74;
 yy4:
-#line 443
+#line 445
{ return 0; }
 yy5:   yych = *++YYCURSOR;
if(yych == ';') goto yy72;
@@ -374,7 +376,7 @@
goto yy4;
 yy13:  yych = *++YYCURSOR;
 yy14:
-#line 437
+#line 439
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of serialized 
data);
@@ -398,7 +400,7 @@
if(yych != '') goto yy2;
 yy21:  yych = *++YYCURSOR;
 yy22:
-#line 352
+#line 354
{
int len;
int elements;
@@ -505,7 +507,7 @@
if(yych != '') goto yy2;
 yy28:  yych = *++YYCURSOR;
 yy29:
-#line 344
+#line 346
{
 
INIT_PZVAL(*rval);
@@ -535,7 +537,7 @@
if(yych != '{') goto yy2;
 yy35:  yych = *++YYCURSOR;
 yy36:
-#line 326
+#line 328
{
int elements = parse_iv(start + 2);
 
@@ -575,7 +577,7 @@
if(yych != '') goto yy2;
 yy42:  yych = *++YYCURSOR;
 yy43:
-#line 306
+#line 308
{
int len;
char *str;
@@ -652,7 +654,7 @@
}
 yy51:  yych = *++YYCURSOR;
 yy52:
-#line 299
+#line 301
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -725,7 +727,7 @@
if(yych != ';') goto yy2;
 yy64:  yych = *++YYCURSOR;
 yy65:
-#line 292
+#line 294
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -752,7 +754,7 @@
if(yych != ';') goto yy2;
 yy70:  yych = *++YYCURSOR;
 yy71:
-#line 285
+#line 287
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -761,7 +763,7 @@
 }
 yy72:  yych = *++YYCURSOR;
 yy73:
-#line 278
+#line 280
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -788,7 +790,7 @@
if(yych != ';') goto yy2;
 yy78:  yych = *++YYCURSOR;
 yy79:
-#line 257
+#line 259
{
int id;
 
@@ -810,7 +812,7 @@
return 1;
 }
 }
-#line 445
+#line 447
 
 
return 0;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2003-07-02 Thread Moriyoshi Koizumi
moriyoshi   Wed Jul  2 12:19:58 2003 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.re var_unserializer.c 
  Log:
  Fixed a leak that occurs with R reference variable specifier.
  
  
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.18 
php-src/ext/standard/var_unserializer.re:1.19
--- php-src/ext/standard/var_unserializer.re:1.18   Wed Jun 25 23:24:11 2003
+++ php-src/ext/standard/var_unserializer.reWed Jul  2 12:19:57 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.18 2003/06/26 03:24:11 sterling Exp $ */
+/* $Id: var_unserializer.re,v 1.19 2003/07/02 16:19:57 moriyoshi Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -265,6 +265,9 @@
return 0;
}
 
+   if (*rval != NULL) {
+   zval_ptr_dtor(rval);
+   }
*rval = *rval_ref;
(*rval)-refcount++;
(*rval)-is_ref = 1;
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.27 
php-src/ext/standard/var_unserializer.c:1.28
--- php-src/ext/standard/var_unserializer.c:1.27Wed Jun 25 23:53:17 2003
+++ php-src/ext/standard/var_unserializer.c Wed Jul  2 12:19:57 2003
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Wed Jun 25 23:00:04 2003 */
-#line 1 /home/rei/PHP_CVS/php-src/ext/standard/var_unserializer.re
+/* Generated by re2c 0.5 on Thu Jul  3 01:22:57 2003 */
+#line 1 /home/koizumi/src/php-src-5/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 4|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.27 2003/06/26 03:53:17 sterling Exp $ */
+/* $Id: var_unserializer.c,v 1.28 2003/07/02 16:19:57 moriyoshi Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -115,6 +115,7 @@
 
 
 
+
 static inline int parse_iv2(const char *p, const char **q)
 {
char cursor;
@@ -338,7 +339,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy74;
 yy4:
-#line 440
+#line 443
{ return 0; }
 yy5:   yych = *++YYCURSOR;
if(yych == ';') goto yy72;
@@ -373,7 +374,7 @@
goto yy4;
 yy13:  yych = *++YYCURSOR;
 yy14:
-#line 434
+#line 437
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of serialized 
data);
@@ -397,7 +398,7 @@
if(yych != '') goto yy2;
 yy21:  yych = *++YYCURSOR;
 yy22:
-#line 349
+#line 352
{
int len;
int elements;
@@ -504,7 +505,7 @@
if(yych != '') goto yy2;
 yy28:  yych = *++YYCURSOR;
 yy29:
-#line 341
+#line 344
{
 
INIT_PZVAL(*rval);
@@ -534,7 +535,7 @@
if(yych != '{') goto yy2;
 yy35:  yych = *++YYCURSOR;
 yy36:
-#line 323
+#line 326
{
int elements = parse_iv(start + 2);
 
@@ -574,7 +575,7 @@
if(yych != '') goto yy2;
 yy42:  yych = *++YYCURSOR;
 yy43:
-#line 303
+#line 306
{
int len;
char *str;
@@ -651,7 +652,7 @@
}
 yy51:  yych = *++YYCURSOR;
 yy52:
-#line 296
+#line 299
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -724,7 +725,7 @@
if(yych != ';') goto yy2;
 yy64:  yych = *++YYCURSOR;
 yy65:
-#line 289
+#line 292
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -751,7 +752,7 @@
if(yych != ';') goto yy2;
 yy70:  yych = *++YYCURSOR;
 yy71:
-#line 282
+#line 285
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -760,7 +761,7 @@
 }
 yy72:  yych = *++YYCURSOR;
 yy73:
-#line 275
+#line 278
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -799,6 +800,9 @@
return 0;
}
 
+   if (*rval != NULL) {
+   zval_ptr_dtor(rval);
+   }
*rval = *rval_ref;
(*rval)-refcount++;
(*rval)-is_ref = 1;
@@ -806,7 +810,7 @@
return 1;
 }
 }
-#line 442
+#line 445
 
 
return 0;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re

2003-06-25 Thread Sterling Hughes
sterlingWed Jun 25 23:24:11 2003 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  fix by ilia to fix crashes in the session extension when /tmp/sess_* files 
  previously existed.  make test now passes fully with the session extension.
  
  
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.25 
php-src/ext/standard/var_unserializer.c:1.26
--- php-src/ext/standard/var_unserializer.c:1.25Tue Jun 10 16:03:39 2003
+++ php-src/ext/standard/var_unserializer.c Wed Jun 25 23:24:11 2003
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Sat May 24 19:11:12 2003 */
-#line 1 /usr/src/php5/ext/standard/var_unserializer.re
+/* Generated by re2c 0.5 on Wed Jun 25 23:00:04 2003 */
+#line 1 /home/rei/PHP_CVS/php-src/ext/standard/var_unserializer.re
 /*
   +--+
   | PHP Version 4|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.25 2003/06/10 20:03:39 imajes Exp $ */
+/* $Id: var_unserializer.c,v 1.26 2003/06/26 03:24:11 sterling Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -339,7 +339,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy74;
 yy4:
-#line 441
+#line 440
{ return 0; }
 yy5:   yych = *++YYCURSOR;
if(yych == ';') goto yy72;
@@ -374,7 +374,7 @@
goto yy4;
 yy13:  yych = *++YYCURSOR;
 yy14:
-#line 435
+#line 434
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of serialized 
data);
@@ -398,7 +398,7 @@
if(yych != '') goto yy2;
 yy21:  yych = *++YYCURSOR;
 yy22:
-#line 350
+#line 349
{
int len;
int elements;
@@ -505,7 +505,7 @@
if(yych != '') goto yy2;
 yy28:  yych = *++YYCURSOR;
 yy29:
-#line 342
+#line 341
{
 
INIT_PZVAL(*rval);
@@ -535,7 +535,7 @@
if(yych != '{') goto yy2;
 yy35:  yych = *++YYCURSOR;
 yy36:
-#line 324
+#line 323
{
int elements = parse_iv(start + 2);
 
@@ -575,7 +575,7 @@
if(yych != '') goto yy2;
 yy42:  yych = *++YYCURSOR;
 yy43:
-#line 304
+#line 303
{
int len;
char *str;
@@ -652,7 +652,7 @@
}
 yy51:  yych = *++YYCURSOR;
 yy52:
-#line 297
+#line 296
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -725,7 +725,7 @@
if(yych != ';') goto yy2;
 yy64:  yych = *++YYCURSOR;
 yy65:
-#line 290
+#line 289
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -752,7 +752,7 @@
if(yych != ';') goto yy2;
 yy70:  yych = *++YYCURSOR;
 yy71:
-#line 283
+#line 282
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -761,7 +761,7 @@
 }
 yy72:  yych = *++YYCURSOR;
 yy73:
-#line 276
+#line 275
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -800,7 +800,6 @@
return 0;
}
 
-   zval_ptr_dtor(rval);
*rval = *rval_ref;
(*rval)-refcount++;
(*rval)-is_ref = 1;
@@ -808,7 +807,7 @@
return 1;
 }
 }
-#line 443
+#line 442
 
 
return 0;
Index: php-src/ext/standard/var_unserializer.re
diff -u php-src/ext/standard/var_unserializer.re:1.17 
php-src/ext/standard/var_unserializer.re:1.18
--- php-src/ext/standard/var_unserializer.re:1.17   Tue Jun 10 16:03:39 2003
+++ php-src/ext/standard/var_unserializer.reWed Jun 25 23:24:11 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.re,v 1.17 2003/06/10 20:03:39 imajes Exp $ */
+/* $Id: var_unserializer.re,v 1.18 2003/06/26 03:24:11 sterling Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -265,7 +265,6 @@
return 0;
}
 
-   zval_ptr_dtor(rval);
*rval = *rval_ref;
(*rval)-refcount++;
(*rval)-is_ref = 1;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c

2003-06-25 Thread Sterling Hughes
sterlingWed Jun 25 23:53:17 2003 EDT

  Modified files:  
/php-src/ext/standard   var_unserializer.c 
  Log:
  touch the file
  
  
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.26 
php-src/ext/standard/var_unserializer.c:1.27
--- php-src/ext/standard/var_unserializer.c:1.26Wed Jun 25 23:24:11 2003
+++ php-src/ext/standard/var_unserializer.c Wed Jun 25 23:53:17 2003
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.26 2003/06/26 03:24:11 sterling Exp $ */
+/* $Id: var_unserializer.c,v 1.27 2003/06/26 03:53:17 sterling Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -112,7 +112,6 @@
 
 
 #line 117
-
 
 
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php