ID:               19493
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           No Feedback
 Bug Type:         Strings related
 Operating System: Linux 2.4.18
 PHP Version:      4.2.3
 New Comment:

No feedback was provided for this bug for over 2 weeks, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".


Previous Comments:
------------------------------------------------------------------------

[2002-10-18 16:49:08] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip



------------------------------------------------------------------------

[2002-09-25 07:24:31] [EMAIL PROTECTED]

While the session module makes use of the serializer, it is not the
serializer itself.

Reclassified as "Strings related".

------------------------------------------------------------------------

[2002-09-20 02:19:10] [EMAIL PROTECTED]

Hello, there is a new patch (without C++-comments :-):

--- ext/standard/var_unserializer.re.old        Thu Sep 19 16:34:32 2002
+++ ext/standard/var_unserializer.re    Fri Sep 20 09:07:25 2002
@@ -144,31 +144,29 @@
                if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) {
                        zval_dtor(key);
                        FREE_ZVAL(key);
-                       return 0;
-               }
-
-               ALLOC_INIT_ZVAL(data);
-
-               if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) {
-                       zval_dtor(key);
-                       FREE_ZVAL(key);
-                       zval_dtor(data);
-                       FREE_ZVAL(data);
-                       return 0;
-               }
+               } else {
+                       ALLOC_INIT_ZVAL(data);
 
-               switch (Z_TYPE_P(key)) {
-                       case IS_LONG:
-                               zend_hash_index_update(ht, Z_LVAL_P(key), &data, 
sizeof(data),
NULL);
-                               break;
-                       case IS_STRING:
-                               zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) 
+ 1, &data,
sizeof(data), NULL);
-                               break;
+                       if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) {
+                               zval_dtor(key);
+                               FREE_ZVAL(key);
+                               zval_dtor(data);
+                               FREE_ZVAL(data);
+                       } else {
+                               switch (Z_TYPE_P(key)) {
+                                       case IS_LONG:
+                                               zend_hash_index_update(ht, 
+Z_LVAL_P(key), &data, sizeof(data),
NULL);
+                                               break;
+                                       case IS_STRING:
+                                               zend_hash_update(ht, Z_STRVAL_P(key), 
+Z_STRLEN_P(key) + 1,
&data, sizeof(data), NULL);
+                                               break;
 
-               }
+                               }
                
-               zval_dtor(key);
-               FREE_ZVAL(key);
+                               zval_dtor(key);
+                               FREE_ZVAL(key);
+                       }
+               }
        }
 
        return 1;

------------------------------------------------------------------------

[2002-09-19 13:17:02] [EMAIL PROTECTED]

No C++ comment styles allowed!  Can you fix that and resubmit the
patch?

------------------------------------------------------------------------

[2002-09-19 09:44:58] [EMAIL PROTECTED]

There is the diff:


--- ext/standard/var_unserializer.re.old        Thu Sep 19 16:34:32 2002
+++ ext/standard/var_unserializer.re    Thu Sep 19 11:20:08 2002
@@ -144,31 +144,29 @@
                if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) {
                        zval_dtor(key);
                        FREE_ZVAL(key);
-                       return 0;
-               }
-
-               ALLOC_INIT_ZVAL(data);
-
-               if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) {
-                       zval_dtor(key);
-                       FREE_ZVAL(key);
-                       zval_dtor(data);
-                       FREE_ZVAL(data);
-                       return 0;
-               }
+               } else {
+                       ALLOC_INIT_ZVAL(data);
 
-               switch (Z_TYPE_P(key)) {
-                       case IS_LONG:
-                               zend_hash_index_update(ht, Z_LVAL_P(key), &data, 
sizeof(data),
NULL);
-                               break;
-                       case IS_STRING:
-                               zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) 
+ 1, &data,
sizeof(data), NULL);
-                               break;
+                       if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) {
+                               zval_dtor(key);
+                               FREE_ZVAL(key);
+                               zval_dtor(data);
+                               FREE_ZVAL(data);
+                       } else {
+                               switch (Z_TYPE_P(key)) {
+                                       case IS_LONG:
+                                               zend_hash_index_update(ht, 
+Z_LVAL_P(key), &data, sizeof(data),
NULL);
+                                               break;
+                                       case IS_STRING:
+                                               zend_hash_update(ht, Z_STRVAL_P(key), 
+Z_STRLEN_P(key) + 1,
&data, sizeof(data), NULL);
+                                               break;
 
-               }
+                               }
                
-               zval_dtor(key);
-               FREE_ZVAL(key);
+                               zval_dtor(key);
+                               FREE_ZVAL(key);
+                       }
+               }
        }
 
        return 1;
@@ -396,9 +394,9 @@
 }
 
 "}" {
-       /* this is the case where we have less data than planned */
+       // this is the case where we have less data than planned
        zend_error(E_NOTICE, "Unexpected end of serialized data");
-       return 0; /* not sure if it should be 0 or 1 here? */
+       return 0; // not sure if it should be 0 or 1 here?
 }
 
 any    { return 0; }

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/19493

-- 
Edit this bug report at http://bugs.php.net/?id=19493&edit=1

Reply via email to