tony2001 Tue Sep 20 07:40:34 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/standard http.c var.c
/php-src/ext/soap php_encoding.c
/php-src/ext/wddx wddx.c
Log:
MF5.1: fix #34505 (Possible memory corruption when unmangling properties with
empty names)
(part 2)
http://cvs.php.net/diff.php/php-src/ext/standard/http.c?r1=1.13&r2=1.13.2.1&ty=u
Index: php-src/ext/standard/http.c
diff -u php-src/ext/standard/http.c:1.13 php-src/ext/standard/http.c:1.13.2.1
--- php-src/ext/standard/http.c:1.13 Fri Jun 4 12:54:14 2004
+++ php-src/ext/standard/http.c Tue Sep 20 07:40:32 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: http.c,v 1.13 2004/06/04 16:54:14 abies Exp $ */
+/* $Id: http.c,v 1.13.2.1 2005/09/20 11:40:32 tony2001 Exp $ */
#include "php_http.h"
#include "php_ini.h"
@@ -69,7 +69,7 @@
/* private or protected property access outside
of the class */
continue;
}
- zend_unmangle_property_name(key, &tmp, &key);
+ zend_unmangle_property_name_ex(key, key_len, &tmp,
&key);
key_len = strlen(key);
}
http://cvs.php.net/diff.php/php-src/ext/standard/var.c?r1=1.191.2.8&r2=1.191.2.9&ty=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.191.2.8
php-src/ext/standard/var.c:1.191.2.9
--- php-src/ext/standard/var.c:1.191.2.8 Tue Jun 28 05:17:19 2005
+++ php-src/ext/standard/var.c Tue Sep 20 07:40:32 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.191.2.8 2005/06/28 09:17:19 stas Exp $ */
+/* $Id: var.c,v 1.191.2.9 2005/09/20 11:40:32 tony2001 Exp $ */
@@ -76,7 +76,7 @@
if (hash_key->nKeyLength ==0 ) { /* numeric key */
php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h);
} else { /* string key */
- zend_unmangle_property_name(hash_key->arKey, &class_name,
&prop_name);
+ zend_unmangle_property_name_ex(hash_key->arKey,
hash_key->nKeyLength, &class_name, &prop_name);
if (class_name) {
php_printf("%*c[\"%s", level + 1, ' ', prop_name);
if (class_name[0]=='*') {
@@ -343,7 +343,7 @@
if (hash_key->nKeyLength != 0) {
php_printf("%*c", level + 1, ' ');
- zend_unmangle_property_name(hash_key->arKey, &class_name,
&prop_name);
+ zend_unmangle_property_name_ex(hash_key->arKey,
hash_key->nKeyLength, &class_name, &prop_name);
if (class_name) {
if (class_name[0] == '*') {
php_printf("protected");
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.71.2.25&r2=1.71.2.26&ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.71.2.25
php-src/ext/soap/php_encoding.c:1.71.2.26
--- php-src/ext/soap/php_encoding.c:1.71.2.25 Wed Aug 24 07:45:57 2005
+++ php-src/ext/soap/php_encoding.c Tue Sep 20 07:40:33 2005
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.71.2.25 2005/08/24 11:45:57 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.71.2.26 2005/09/20 11:40:33 tony2001 Exp $ */
#include <time.h>
@@ -1573,9 +1573,9 @@
zval **zprop;
char *str_key;
ulong index;
- int key_type;
+ int key_type, str_key_len;
- key_type = zend_hash_get_current_key(prop,
&str_key, &index, FALSE);
+ key_type = zend_hash_get_current_key_ex(prop,
&str_key, &str_key_len, &index, FALSE, NULL);
zend_hash_get_current_data(prop, (void
**)&zprop);
property =
master_to_xml(get_conversion((*zprop)->type), (*zprop), style, xmlParam);
@@ -1586,7 +1586,7 @@
if (Z_TYPE_P(data) == IS_OBJECT) {
char *class_name;
-
zend_unmangle_property_name(str_key, &class_name, &prop_name);
+
zend_unmangle_property_name_ex(str_key, str_key_len, &class_name, &prop_name);
} else {
prop_name = str_key;
}
http://cvs.php.net/diff.php/php-src/ext/wddx/wddx.c?r1=1.111.2.3&r2=1.111.2.4&ty=u
Index: php-src/ext/wddx/wddx.c
diff -u php-src/ext/wddx/wddx.c:1.111.2.3 php-src/ext/wddx/wddx.c:1.111.2.4
--- php-src/ext/wddx/wddx.c:1.111.2.3 Mon May 30 11:13:57 2005
+++ php-src/ext/wddx/wddx.c Tue Sep 20 07:40:34 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: wddx.c,v 1.111.2.3 2005/05/30 15:13:57 sniper Exp $ */
+/* $Id: wddx.c,v 1.111.2.4 2005/09/20 11:40:34 tony2001 Exp $ */
#include "php.h"
@@ -524,7 +524,7 @@
if (zend_hash_get_current_key_ex(HASH_OF(obj), &key,
&key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) {
char *class_name, *prop_name;
- zend_unmangle_property_name(key, &class_name,
&prop_name);
+ zend_unmangle_property_name_ex(key, key_len,
&class_name, &prop_name);
php_wddx_serialize_var(packet, *ent, prop_name,
strlen(prop_name)+1 TSRMLS_CC);
} else {
key_len = sprintf(tmp_buf, "%ld", idx);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php