iliaa           Wed Aug 10 18:45:31 2005 EDT

  Modified files:              (Branch: PHP_5_1)
    /php-src    NEWS 
    /php-src/ext/wddx   wddx.c 
  Log:
  MFH: Fixed bug #34068 (Numeric string as array key not cast to integer in
  wddx_deserialize()).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.9&r2=1.2027.2.10&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.9 php-src/NEWS:1.2027.2.10
--- php-src/NEWS:1.2027.2.9     Wed Aug 10 09:10:58 2005
+++ php-src/NEWS        Wed Aug 10 18:45:30 2005
@@ -10,6 +10,8 @@
 - Fixed "make test" to work for phpized extensions. (Hartmut, Jani)
 - Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems.
   (Andrey)
+- Fixed bug #34068 (Numeric string as array key not cast to integer in 
+  wddx_deserialize()). (Ilia)
 - Fixed bug #34064 (arr[] as param to function in class gives invalid opcode).
   (Dmitry)
 - Fixed bug #34062 (Crash in catch block when many arguments are used).
http://cvs.php.net/diff.php/php-src/ext/wddx/wddx.c?r1=1.119&r2=1.119.2.1&ty=u
Index: php-src/ext/wddx/wddx.c
diff -u php-src/ext/wddx/wddx.c:1.119 php-src/ext/wddx/wddx.c:1.119.2.1
--- php-src/ext/wddx/wddx.c:1.119       Wed Aug  3 10:08:20 2005
+++ php-src/ext/wddx/wddx.c     Wed Aug 10 18:45:31 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: wddx.c,v 1.119 2005/08/03 14:08:20 sniper Exp $ */
+/* $Id: wddx.c,v 1.119.2.1 2005/08/10 22:45:31 iliaa Exp $ */
 
 #include "php.h"
 
@@ -997,10 +997,20 @@
                                                ent1->data->refcount--;
                                                add_property_zval(ent2->data, 
ent1->varname, ent1->data);
                                                EG(scope) = old_scope;
-                                       } else
-                                               zend_hash_update(target_hash,
-                                                                               
 ent1->varname, strlen(ent1->varname)+1,
-                                                                               
 &ent1->data, sizeof(zval *), NULL);
+                                       } else {
+                                               long l;  
+                                               double d;
+                               
+                                               switch 
(is_numeric_string(ent1->varname, strlen(ent1->varname), &l, &d, 0)) {
+                                                       case IS_DOUBLE:
+                                                               l = (long) d;
+                                                       case IS_LONG:
+                                                               
zend_hash_index_update(target_hash, l, &ent1->data, sizeof(zval *), NULL);
+                                                               break;
+                                                       default:
+                                                               
zend_hash_update(target_hash,ent1->varname, strlen(ent1->varname)+1, 
&ent1->data, sizeof(zval *), NULL);
+                                               }
+                                       }
                                        efree(ent1->varname);
                                } else  {
                                        zend_hash_next_index_insert(target_hash,

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

Reply via email to