com php-src: basic fix for ext/soap: ext/soap/php_encoding. c ext/soap/php_http.c ext/soap/php_http.h ext/soa p/php_schema.c ext/soap/php_sdl.c
ext/soap/php_sd l.h ext/soap/php_soap.h ext/soap/soap.c

From: Date: Fri, 29 Nov 2013 15:55:00 +0000
Subject: com php-src: basic fix for ext/soap: ext/soap/php_encoding. c ext/soap/php_http.c ext/soap/php_http.h ext/soa p/php_schema.c ext/soap/php_sdl.c
ext/soap/php_sd l.h ext/soap/php_soap.h ext/soap/soap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74165@lists.php.net to get a copy of this message
Commit: 132bd2130d85e2a9faf87f22bc51543ef2ba7226 Author: Anatol Belski <ab@php.net> Fri, 29 Nov 2013 16:55:00 +0100 Parents: eabdd0e4a5fdfa77ad9dd5f7b9e1387106fc31ff Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=132bd2130d85e2a9faf87f22bc51543ef2ba7226 Log: basic fix for ext/soap Changed paths: M ext/soap/php_encoding.c M ext/soap/php_http.c M ext/soap/php_http.h M ext/soap/php_schema.c M ext/soap/php_sdl.c M ext/soap/php_sdl.h M ext/soap/php_soap.h M ext/soap/soap.c

diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 5cec3e5..f1f1b5d 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -298,7 +298,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) { if (Z_TYPE_P(data) == IS_OBJECT) { data = (zval*)zend_objects_get_address(data TSRMLS_CC); } - if (zend_hash_index_find(SOAP_GLOBAL(ref_map), (ulong)data, (void**)&node_ptr) == SUCCESS) { + if (zend_hash_index_find(SOAP_GLOBAL(ref_map), (php_uint_t)data, (void**)&node_ptr) == SUCCESS) { xmlAttrPtr attr = (*node_ptr)->properties; char *id; smart_str prefix = {0}; @@ -352,7 +352,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) { smart_str_free(&prefix); return 1; } else { - zend_hash_index_update(SOAP_GLOBAL(ref_map), (ulong)data, (void**)&node, sizeof(xmlNodePtr), NULL); + zend_hash_index_update(SOAP_GLOBAL(ref_map), (php_uint_t)data, (void**)&node, sizeof(xmlNodePtr), NULL); } } return 0; @@ -363,7 +363,7 @@ static zval* soap_find_xml_ref(xmlNodePtr node TSRMLS_DC) zval **data_ptr; if (SOAP_GLOBAL(ref_map) && - zend_hash_index_find(SOAP_GLOBAL(ref_map), (ulong)node, (void**)&data_ptr) == SUCCESS) { + zend_hash_index_find(SOAP_GLOBAL(ref_map), (php_uint_t)node, (void**)&data_ptr) == SUCCESS) { Z_SET_ISREF_PP(data_ptr); Z_ADDREF_PP(data_ptr); return *data_ptr; @@ -376,7 +376,7 @@ static zend_bool soap_check_xml_ref(zval **data, xmlNodePtr node TSRMLS_DC) zval **data_ptr; if (SOAP_GLOBAL(ref_map)) { - if (zend_hash_index_find(SOAP_GLOBAL(ref_map), (ulong)node, (void**)&data_ptr) == SUCCESS) { + if (zend_hash_index_find(SOAP_GLOBAL(ref_map), (php_uint_t)node, (void**)&data_ptr) == SUCCESS) { if (*data != *data_ptr) { zval_ptr_dtor(data); *data = *data_ptr; @@ -385,7 +385,7 @@ static zend_bool soap_check_xml_ref(zval **data, xmlNodePtr node TSRMLS_DC) return 1; } } else { - zend_hash_index_update(SOAP_GLOBAL(ref_map), (ulong)node, (void**)data, sizeof(zval*), NULL); + zend_hash_index_update(SOAP_GLOBAL(ref_map), (php_uint_t)node, (void**)data, sizeof(zval*), NULL); } } return 0; @@ -413,17 +413,17 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype)); } else { zns = NULL; - enc = get_encoder_ex(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype)); + enc = get_encoder_ex(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zstype), Z_STRSIZE_PP(zstype)); } if (enc == NULL && SOAP_GLOBAL(typemap)) { encodePtr *new_enc; smart_str nscat = {0}; if (zns != NULL) { - smart_str_appendl(&nscat, Z_STRVAL_PP(zns), Z_STRLEN_PP(zns)); + smart_str_appendl(&nscat, Z_STRVAL_PP(zns), Z_STRSIZE_PP(zns)); smart_str_appendc(&nscat, ':'); } - smart_str_appendl(&nscat, Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype)); + smart_str_appendl(&nscat, Z_STRVAL_PP(zstype), Z_STRSIZE_PP(zstype)); smart_str_0(&nscat); if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) { enc = *new_enc; @@ -469,14 +469,14 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml HashPosition pos; zval **tmp; char *type_name = NULL; - uint type_len; - ulong idx; + zend_str_size_uint type_len; + php_uint_t idx; for (zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(class_map), &pos); zend_hash_get_current_data_ex(SOAP_GLOBAL(class_map), (void **) &tmp, &pos) == SUCCESS; zend_hash_move_forward_ex(SOAP_GLOBAL(class_map), &pos)) { if (Z_TYPE_PP(tmp) == IS_STRING && - ce->name_length == Z_STRLEN_PP(tmp) && + ce->name_length == Z_STRSIZE_PP(tmp) && zend_binary_strncasecmp(ce->name, ce->name_length, Z_STRVAL_PP(tmp), ce->name_length, ce->name_length) == 0 && zend_hash_get_current_key_ex(SOAP_GLOBAL(class_map), &type_name, &type_len, &idx, 0, &pos) == HASH_KEY_IS_STRING) { @@ -629,7 +629,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par soap_error0(E_ERROR, "Encoding: Error calling to_xml callback"); } if (Z_TYPE_P(return_value) == IS_STRING) { - xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value)); + xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL_P(return_value), Z_STRSIZE_P(return_value)); if (doc && doc->children) { ret = xmlDocCopyNode(doc->children, parent->doc, 1); } @@ -784,7 +784,7 @@ static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data TSRMLS_DC) { zval *ret; char *str; - int str_len; + zend_str_size_int str_len; MAKE_STD_ZVAL(ret); FIND_XML_NULL(data, ret); @@ -870,15 +870,15 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo FIND_ZVAL_NULL(data, ret, style); if (Z_TYPE_P(data) == IS_STRING) { - str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); - new_len = Z_STRLEN_P(data); + str = estrndup(Z_STRVAL_P(data), Z_STRSIZE_P(data)); + new_len = Z_STRSIZE_P(data); } else { zval tmp = *data; zval_copy_ctor(&tmp); convert_to_string(&tmp); - str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); - new_len = Z_STRLEN(tmp); + str = estrndup(Z_STRVAL(tmp), Z_STRSIZE(tmp)); + new_len = Z_STRSIZE(tmp); zval_dtor(&tmp); } @@ -951,14 +951,14 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo { xmlNodePtr ret, text; unsigned char *str; - int str_len; + zend_str_size_int str_len; ret = xmlNewNode(NULL, BAD_CAST("BOGUS")); xmlAddChild(parent, ret); FIND_ZVAL_NULL(data, ret, style); if (Z_TYPE_P(data) == IS_STRING) { - str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data), &str_len); + str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRSIZE_P(data), &str_len); text = xmlNewTextLen(str, str_len); xmlAddChild(ret, text); efree(str); @@ -967,7 +967,7 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo zval_copy_ctor(&tmp); convert_to_string(&tmp); - str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp), &str_len); + str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRSIZE(tmp), &str_len); text = xmlNewTextLen(str, str_len); xmlAddChild(ret, text); efree(str); @@ -998,15 +998,15 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo convert_to_string(&tmp); data = &tmp; } - str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1); + str = (unsigned char *) safe_emalloc(Z_STRSIZE_P(data) * 2, sizeof(char), 1); - for (i = j = 0; i < Z_STRLEN_P(data); i++) { + for (i = j = 0; i < Z_STRSIZE_P(data); i++) { str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) >> 4]; str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) & 15]; } str[j] = '\0'; - text = xmlNewTextLen(str, Z_STRLEN_P(data) * 2 * sizeof(char)); + text = xmlNewTextLen(str, Z_STRSIZE_P(data) * 2 * sizeof(char)); xmlAddChild(ret, text); efree(str); if (data == &tmp) { @@ -1027,7 +1027,7 @@ static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data TSRMLS_DC) if (data && data->children) { if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - long lval; + php_int_t lval; double dval; whiteSpace_collapse(data->children->content); @@ -1068,7 +1068,7 @@ static zval *to_zval_long(encodeTypePtr type, xmlNodePtr data TSRMLS_DC) if (data && data->children) { if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { - long lval; + php_int_t lval; double dval; whiteSpace_collapse(data->children->content); @@ -1114,7 +1114,7 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode convert_to_long(&tmp); } convert_to_string(&tmp); - xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp)); + xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRSIZE(tmp)); zval_dtor(&tmp); } @@ -1486,7 +1486,7 @@ static zval *to_zval_object_ex(encodeTypePtr type, xmlNodePtr data, zend_class_e if (zend_hash_find(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str)+1, (void**)&classname) == SUCCESS && Z_TYPE_PP(classname) == IS_STRING && - (tmp = zend_fetch_class(Z_STRVAL_PP(classname), Z_STRLEN_PP(classname), ZEND_FETCH_CLASS_AUTO TSRMLS_CC)) != NULL) { + (tmp = zend_fetch_class(Z_STRVAL_PP(classname), Z_STRSIZE_PP(classname), ZEND_FETCH_CLASS_AUTO TSRMLS_CC)) != NULL) { ce = tmp; } } @@ -2053,9 +2053,9 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo xmlNodePtr property; zval **zprop; char *str_key; - ulong index; + php_uint_t index; int key_type; - unsigned int str_key_len; + zend_str_size_uint str_key_len; 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); @@ -2787,7 +2787,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP xmlNodePtr key; zval **temp_data; char *key_val; - ulong int_val; + php_uint_t int_val; zend_hash_get_current_data(data->value.ht, (void **)&temp_data); item = xmlNewNode(NULL, BAD_CAST("item")); @@ -2853,7 +2853,7 @@ static zval *to_zval_map(encodeTypePtr type, xmlNodePtr data TSRMLS_DC) value = master_to_zval(NULL, xmlValue TSRMLS_CC); if (Z_TYPE_P(key) == IS_STRING) { - zend_symtable_update(Z_ARRVAL_P(ret), Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL); + zend_symtable_update(Z_ARRVAL_P(ret), Z_STRVAL_P(key), Z_STRSIZE_P(key) + 1, &value, sizeof(zval *), NULL); } else if (Z_TYPE_P(key) == IS_LONG) { zend_hash_index_update(Z_ARRVAL_P(ret), Z_LVAL_P(key), &value, sizeof(zval *), NULL); } else { @@ -3026,7 +3026,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma xmlNodeSetContent(xmlParam, BAD_CAST(buf)); efree(buf); } else if (Z_TYPE_P(data) == IS_STRING) { - xmlNodeSetContentLen(xmlParam, BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data)); + xmlNodeSetContentLen(xmlParam, BAD_CAST(Z_STRVAL_P(data)), Z_STRSIZE_P(data)); } if (style == SOAP_ENCODED) { @@ -3136,7 +3136,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP convert_to_string(&tmp); data = &tmp; } - str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); + str = estrndup(Z_STRVAL_P(data), Z_STRSIZE_P(data)); whiteSpace_collapse(BAD_CAST(str)); start = str; while (start != NULL && *start != '\0') { @@ -3228,8 +3228,8 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP zval **el; encodePtr enc = get_conversion(XSD_ANYXML); char *name; - uint name_len; - ulong idx; + zend_str_size_uint name_len; + php_uint_t idx; for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(data), &pos); zend_hash_get_current_data_ex(Z_ARRVAL_P(data), (void **) &el, &pos) == SUCCESS; @@ -3244,13 +3244,13 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP return ret; } if (Z_TYPE_P(data) == IS_STRING) { - ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data)); + ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRSIZE_P(data)); } else { zval tmp = *data; zval_copy_ctor(&tmp); convert_to_string(&tmp); - ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp)); + ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRSIZE(tmp)); zval_dtor(&tmp); } @@ -3351,20 +3351,20 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo if (type) { if (type->restrictions && Z_TYPE_P(data) == IS_STRING) { if (type->restrictions->enumeration) { - if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) { + if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRSIZE_P(data)+1)) { soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data)); } } if (type->restrictions->minLength && - Z_STRLEN_P(data) < type->restrictions->minLength->value) { + Z_STRSIZE_P(data) < type->restrictions->minLength->value) { soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'"); } if (type->restrictions->maxLength && - Z_STRLEN_P(data) > type->restrictions->maxLength->value) { + Z_STRSIZE_P(data) > type->restrictions->maxLength->value) { soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); } if (type->restrictions->length && - Z_STRLEN_P(data) != type->restrictions->length->value) { + Z_STRSIZE_P(data) != type->restrictions->length->value) { soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); } } @@ -3604,7 +3604,7 @@ static int is_map(zval *array) zend_hash_internal_pointer_reset(Z_ARRVAL_P(array)); for (i = 0; i < count; i++) { char *str_index; - ulong num_index; + php_uint_t num_index; if (zend_hash_get_current_key(Z_ARRVAL_P(array), &str_index, &num_index, 0) == HASH_KEY_IS_STRING || num_index != i) { diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 86ab03d..5bec57b 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -38,13 +38,13 @@ int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC) if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS) { unsigned char* buf; - int len; + zend_str_size_int len; smart_str auth = {0}; - smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); + smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRSIZE_PP(login)); smart_str_appendc(&auth, ':'); if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_password", sizeof("_proxy_password"), (void **)&password) == SUCCESS) { - smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password)); + smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRSIZE_PP(password)); } smart_str_0(&auth); buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len); @@ -66,13 +66,13 @@ int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC) if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS && !zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"))) { unsigned char* buf; - int len; + zend_str_size_int len; smart_str auth = {0}; - smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); + smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRSIZE_PP(login)); smart_str_appendc(&auth, ':'); if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS) { - smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password)); + smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRSIZE_PP(password)); } smart_str_0(&auth); buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len); @@ -97,7 +97,7 @@ void http_context_headers(php_stream_context* context, if (context && php_stream_context_get_option(context, "http", "header", &tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp)) { + Z_TYPE_PP(tmp) == IS_STRING && Z_STRSIZE_PP(tmp)) { char *s = Z_STRVAL_PP(tmp); char *p; int name_len; @@ -163,7 +163,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph char *host; char *name; char *protocol; - long namelen; + php_int_t namelen; int port; int old_error_reporting; struct timeval tv; @@ -328,12 +328,12 @@ static int in_domain(const char *host, const char *domain) int make_http_soap_request(zval *this_ptr, char *buf, - int buf_size, + zend_str_size_int buf_size, char *location, char *soapaction, int soap_version, char **buffer, - int *buffer_len TSRMLS_DC) + zend_str_size_int *buffer_len TSRMLS_DC) { char *request; smart_str soap_headers = {0}; @@ -350,7 +350,7 @@ int make_http_soap_request(zval *this_ptr, int http_1_1; int http_status; int content_type_xml = 0; - long redirect_max = 20; + php_int_t redirect_max = 20; char *content_encoding; char *http_msg = NULL; zend_bool old_allow_url_fopen; @@ -403,7 +403,7 @@ int make_http_soap_request(zval *this_ptr, if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, n, params TSRMLS_CC) == SUCCESS && Z_TYPE(retval) == IS_STRING) { request = Z_STRVAL(retval); - request_size = Z_STRLEN(retval); + request_size = Z_STRSIZE(retval); } else { if (request != buf) {efree(request);} smart_str_free(&soap_headers_z); @@ -432,7 +432,7 @@ int make_http_soap_request(zval *this_ptr, if (context && php_stream_context_get_option(context, "http", "max_redirects", &tmp) == SUCCESS) { - if (Z_TYPE_PP(tmp) != IS_STRING || !is_numeric_string(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &redirect_max, NULL, 1)) { + if (Z_TYPE_PP(tmp) != IS_STRING || !is_numeric_string(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), &redirect_max, NULL, 1)) { if (Z_TYPE_PP(tmp) == IS_LONG) redirect_max = Z_LVAL_PP(tmp); } @@ -580,17 +580,17 @@ try_again: } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - if (Z_STRLEN_PP(tmp) > 0) { + if (Z_STRSIZE_PP(tmp) > 0) { smart_str_append_const(&soap_headers, "User-Agent: "); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); smart_str_append_const(&soap_headers, "\r\n"); } } else if (context && php_stream_context_get_option(context, "http", "user_agent", &tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - if (Z_STRLEN_PP(tmp) > 0) { + if (Z_STRSIZE_PP(tmp) > 0) { smart_str_append_const(&soap_headers, "User-Agent: "); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); smart_str_append_const(&soap_headers, "\r\n"); } } else if (FG(user_agent)) { @@ -651,29 +651,29 @@ try_again: } PHP_MD5Init(&md5ctx); - PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(login), Z_STRLEN_PP(login)); + PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(login), Z_STRSIZE_PP(login)); PHP_MD5Update(&md5ctx, (unsigned char*)":", 1); if (zend_hash_find(Z_ARRVAL_PP(digest), "realm", sizeof("realm"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } PHP_MD5Update(&md5ctx, (unsigned char*)":", 1); if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS && Z_TYPE_PP(password) == IS_STRING) { - PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(password), Z_STRLEN_PP(password)); + PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(password), Z_STRSIZE_PP(password)); } PHP_MD5Final(hash, &md5ctx); make_digest(HA1, hash); if (zend_hash_find(Z_ARRVAL_PP(digest), "algorithm", sizeof("algorithm"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING && - Z_STRLEN_PP(tmp) == sizeof("md5-sess")-1 && + Z_STRSIZE_PP(tmp) == sizeof("md5-sess")-1 && stricmp(Z_STRVAL_PP(tmp), "md5-sess") == 0) { PHP_MD5Init(&md5ctx); PHP_MD5Update(&md5ctx, (unsigned char*)HA1, 32); PHP_MD5Update(&md5ctx, (unsigned char*)":", 1); if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } PHP_MD5Update(&md5ctx, (unsigned char*)":", 1); PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, 8); @@ -697,7 +697,7 @@ try_again: /* if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING && - Z_STRLEN_PP(tmp) == sizeof("auth-int")-1 && + Z_STRSIZE_PP(tmp) == sizeof("auth-int")-1 && stricmp(Z_STRVAL_PP(tmp), "auth-int") == 0) { PHP_MD5Update(&md5ctx, ":", 1); PHP_MD5Update(&md5ctx, HEntity, HASHHEXLEN); @@ -711,7 +711,7 @@ try_again: PHP_MD5Update(&md5ctx, (unsigned char*)":", 1); if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } PHP_MD5Update(&md5ctx, (unsigned char*)":", 1); if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS && @@ -729,16 +729,16 @@ try_again: make_digest(response, hash); smart_str_append_const(&soap_headers, "Authorization: Digest username=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(login), Z_STRSIZE_PP(login)); if (zend_hash_find(Z_ARRVAL_PP(digest), "realm", sizeof("realm"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { smart_str_append_const(&soap_headers, "\", realm=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { smart_str_append_const(&soap_headers, "\", nonce=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } smart_str_append_const(&soap_headers, "\", uri=\""); if (phpurl->path) { @@ -768,25 +768,25 @@ try_again: if (zend_hash_find(Z_ARRVAL_PP(digest), "opaque", sizeof("opaque"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { smart_str_append_const(&soap_headers, "\", opaque=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } if (zend_hash_find(Z_ARRVAL_PP(digest), "algorithm", sizeof("algorithm"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { smart_str_append_const(&soap_headers, "\", algorithm=\""); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } smart_str_append_const(&soap_headers, "\"\r\n"); } } else { unsigned char* buf; - int len; + zend_str_size_int len; smart_str auth = {0}; - smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login)); + smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRSIZE_PP(login)); smart_str_appendc(&auth, ':'); if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS && Z_TYPE_PP(password) == IS_STRING) { - smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password)); + smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRSIZE_PP(password)); } smart_str_0(&auth); buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len); @@ -825,13 +825,13 @@ try_again: Z_TYPE_PP(value) == IS_STRING) { zval **tmp; if ((zend_hash_index_find(Z_ARRVAL_PP(data), 1, (void**)&tmp) == FAILURE || - strncmp(phpurl->path?phpurl->path:"/",Z_STRVAL_PP(tmp),Z_STRLEN_PP(tmp)) == 0) && + strncmp(phpurl->path?phpurl->path:"/",Z_STRVAL_PP(tmp),Z_STRSIZE_PP(tmp)) == 0) && (zend_hash_index_find(Z_ARRVAL_PP(data), 2, (void**)&tmp) == FAILURE || in_domain(phpurl->host,Z_STRVAL_PP(tmp))) && (use_ssl || zend_hash_index_find(Z_ARRVAL_PP(data), 3, (void**)&tmp) == FAILURE)) { smart_str_appendl(&soap_headers, key, strlen(key)); smart_str_appendc(&soap_headers, '='); - smart_str_appendl(&soap_headers, Z_STRVAL_PP(value), Z_STRLEN_PP(value)); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(value), Z_STRSIZE_PP(value)); smart_str_appendc(&soap_headers, ';'); } } @@ -1268,7 +1268,7 @@ try_again: Z_TYPE(retval) == IS_STRING) { efree(http_body); *buffer = Z_STRVAL(retval); - *buffer_len = Z_STRLEN(retval); + *buffer_len = Z_STRSIZE(retval); } else { efree(content_encoding); efree(http_headers); diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h index 70d2cfd..7640e09 100644 --- a/ext/soap/php_http.h +++ b/ext/soap/php_http.h @@ -24,12 +24,12 @@ int make_http_soap_request(zval *this_ptr, char *request, - int request_size, + zend_str_size_int request_size, char *location, char *soapaction, int soap_version, char **response, - int *response_len TSRMLS_DC); + zend_str_size_int *response_len TSRMLS_DC); int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC); int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC); diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index 25bb177..db51162 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -2141,7 +2141,7 @@ static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashT while (zend_hash_get_current_data((*tmp)->attributes,(void**)&tmp_attr) == SUCCESS) { if (zend_hash_get_current_key_type((*tmp)->attributes) == HASH_KEY_IS_STRING) { char* key; - uint key_len; + zend_str_size_uint key_len; sdlAttributePtr newAttr; schema_attribute_fixup(ctx,*tmp_attr); @@ -2165,7 +2165,7 @@ static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashT zend_hash_move_forward((*tmp)->attributes); } else { - ulong index; + php_uint_t index; schema_attributegroup_fixup(ctx,*tmp_attr, ht); zend_hash_get_current_key((*tmp)->attributes, NULL, &index, 0); @@ -2276,7 +2276,7 @@ static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) schema_attribute_fixup(ctx,*attr); zend_hash_move_forward(type->attributes); } else { - ulong index; + php_uint_t index; schema_attributegroup_fixup(ctx,*attr,type->attributes); zend_hash_get_current_key(type->attributes, NULL, &index, 0); diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index f8c6940..0c93aad 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -293,10 +293,10 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC) rest += 2; Z_TYPE(new_header) = IS_STRING; - Z_STRLEN(new_header) = Z_STRLEN_PP(header) - (rest - s); - Z_STRVAL(new_header) = emalloc(Z_STRLEN_PP(header) + 1); + Z_STRSIZE(new_header) = Z_STRSIZE_PP(header) - (rest - s); + Z_STRVAL(new_header) = emalloc(Z_STRSIZE_PP(header) + 1); memcpy(Z_STRVAL(new_header), Z_STRVAL_PP(header), s - Z_STRVAL_PP(header)); - memcpy(Z_STRVAL(new_header) + (s - Z_STRVAL_PP(header)), rest, Z_STRLEN_PP(header) - (rest - Z_STRVAL_PP(header)) + 1); + memcpy(Z_STRVAL(new_header) + (s - Z_STRVAL_PP(header)), rest, Z_STRSIZE_PP(header) - (rest - Z_STRVAL_PP(header)) + 1); ctx->old_header = *header; Z_ADDREF_P(ctx->old_header); php_stream_context_set_option(ctx->context, "http", "header", &new_header); @@ -1800,8 +1800,8 @@ static void sdl_serialize_string(const char *str, smart_str *out) static void sdl_serialize_key(HashTable *ht, smart_str *out) { char *key; - uint key_len; - ulong index; + zend_str_size_uint key_len; + php_uint_t index; if (zend_hash_get_current_key_ex(ht, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) { WSDL_CACHE_PUT_INT(key_len, out); @@ -2442,9 +2442,9 @@ static HashTable* make_persistent_sdl_function_headers(HashTable *headers, HashT sdlSoapBindingFunctionHeaderPtr *tmp, pheader; encodePtr *penc; sdlTypePtr *ptype; - ulong index; + php_uint_t index; char *key; - uint key_len; + zend_str_size_uint key_len; pheaders = malloc(sizeof(HashTable)); zend_hash_init(pheaders, zend_hash_num_elements(headers), NULL, delete_header_persistent, 1); @@ -2510,9 +2510,9 @@ static HashTable* make_persistent_sdl_parameters(HashTable *params, HashTable *p sdlParamPtr *tmp, pparam; sdlTypePtr *ptype; encodePtr *penc; - ulong index; + php_uint_t index; char *key; - uint key_len; + zend_str_size_uint key_len; pparams = malloc(sizeof(HashTable)); zend_hash_init(pparams, zend_hash_num_elements(params), NULL, delete_parameter_persistent, 1); @@ -2557,9 +2557,9 @@ static HashTable* make_persistent_sdl_function_faults(sdlFunctionPtr func, HashT { HashTable *pfaults; sdlFaultPtr *tmp, pfault; - ulong index; + php_uint_t index; char *key; - uint key_len; + zend_str_size_uint key_len; pfaults = malloc(sizeof(HashTable)); zend_hash_init(pfaults, zend_hash_num_elements(faults), NULL, delete_fault_persistent, 1); @@ -2606,9 +2606,9 @@ static HashTable* make_persistent_sdl_function_faults(sdlFunctionPtr func, HashT static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders) { sdlAttributePtr pattr; - ulong index; + php_uint_t index; char *key; - uint key_len; + zend_str_size_uint key_len; pattr = malloc(sizeof(sdlAttribute)); memset(pattr, 0, sizeof(sdlAttribute)); @@ -2718,9 +2718,9 @@ static sdlContentModelPtr make_persistent_sdl_model(sdlContentModelPtr model, Ha static sdlTypePtr make_persistent_sdl_type(sdlTypePtr type, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders) { - ulong index; + php_uint_t index; char *key; - uint key_len; + zend_str_size_uint key_len; sdlTypePtr ptype = NULL; ptype = malloc(sizeof(sdlType)); @@ -2952,9 +2952,9 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC) sdlPtr psdl = NULL; HashTable ptr_map; HashTable bp_types, bp_encoders; - ulong index; + php_uint_t index; char *key; - uint key_len; + zend_str_size_uint key_len; zend_hash_init(&bp_types, 0, NULL, NULL, 0); zend_hash_init(&bp_encoders, 0, NULL, NULL, 0); @@ -3186,7 +3186,7 @@ static void delete_psdl(void *data) free(tmp); } -sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) +sdlPtr get_sdl(zval *this_ptr, char *uri, php_int_t cache_wsdl TSRMLS_DC) { char fn[MAXPATHLEN]; sdlPtr sdl = NULL; @@ -3263,7 +3263,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **) &tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp) > 0) { + Z_TYPE_PP(tmp) == IS_STRING && Z_STRSIZE_PP(tmp) > 0) { smart_str_appends(&headers, "User-Agent: "); smart_str_appends(&headers, Z_STRVAL_PP(tmp)); smart_str_appends(&headers, "\r\n"); @@ -3377,8 +3377,8 @@ cache_in_memory: HashPosition pos; time_t latest = t; char *key = NULL; - uint key_len; - ulong idx; + zend_str_size_uint key_len; + php_uint_t idx; for (zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(mem_cache), &pos); zend_hash_get_current_data_ex(SOAP_GLOBAL(mem_cache), (void **) &q, &pos) == SUCCESS; diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h index 78757d1..63a9c91 100644 --- a/ext/soap/php_sdl.h +++ b/ext/soap/php_sdl.h @@ -254,7 +254,7 @@ struct _sdlAttribute { }; -sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC); +sdlPtr get_sdl(zval *this_ptr, char *uri, php_int_t cache_wsdl TSRMLS_DC); encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type); encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type); diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index 7d0a3c1..94e2ba5 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -171,8 +171,8 @@ ZEND_BEGIN_MODULE_GLOBALS(soap) char cache_mode; char cache_enabled; char* cache_dir; - long cache_ttl; - long cache_limit; + php_int_t cache_ttl; + php_int_t cache_limit; HashTable *mem_cache; xmlCharEncodingHandlerPtr encoding; HashTable *class_map; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index c5900dc..d6df066 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -164,7 +164,7 @@ zend_class_entry* soap_var_class_entry; ZEND_DECLARE_MODULE_GLOBALS(soap) -static void (*old_error_handler)(int, const char *, const uint, const char*, va_list); +static void (*old_error_handler)(int, const char *, const zend_str_size_uint, const char*, va_list); #ifdef va_copy #define call_old_error_handler(error_num, error_filename, error_lineno, format, args) \ @@ -781,9 +781,9 @@ PHP_METHOD(SoapParam, SoapParam) { zval *data; char *name; - int name_length; + zend_str_size_int name_length; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &data, &name, &name_length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS", &data, &name, &name_length) == FAILURE) { return; } if (name_length == 0) { @@ -803,10 +803,10 @@ PHP_METHOD(SoapHeader, SoapHeader) { zval *data = NULL, *actor = NULL; char *name, *ns; - int name_len, ns_len; + zend_str_size_int name_len, ns_len; zend_bool must_understand = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) { return; } if (ns_len == 0) { @@ -830,8 +830,8 @@ PHP_METHOD(SoapHeader, SoapHeader) Z_LVAL_P(actor) == SOAP_ACTOR_NONE || Z_LVAL_P(actor) == SOAP_ACTOR_UNLIMATERECEIVER)) { add_property_long(this_ptr, "actor", Z_LVAL_P(actor)); - } else if (Z_TYPE_P(actor) == IS_STRING && Z_STRLEN_P(actor) > 0) { - add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor), 1); + } else if (Z_TYPE_P(actor) == IS_STRING && Z_STRSIZE_P(actor) > 0) { + add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRSIZE_P(actor), 1); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid actor"); } @@ -842,10 +842,10 @@ PHP_METHOD(SoapHeader, SoapHeader) PHP_METHOD(SoapFault, SoapFault) { char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *name = NULL, *fault_code_ns = NULL; - int fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0; + zend_str_size_int fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0; zval *code = NULL, *details = NULL, *headerfault = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s!z!s!z", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS|S!z!S!z", &code, &fault_string, &fault_string_len, &fault_actor, &fault_actor_len, @@ -856,7 +856,7 @@ PHP_METHOD(SoapFault, SoapFault) if (Z_TYPE_P(code) == IS_NULL) { } else if (Z_TYPE_P(code) == IS_STRING) { fault_code = Z_STRVAL_P(code); - fault_code_len = Z_STRLEN_P(code); + fault_code_len = Z_STRSIZE_P(code); } else if (Z_TYPE_P(code) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(code)) == 2) { zval **t_ns, **t_code; @@ -867,7 +867,7 @@ PHP_METHOD(SoapFault, SoapFault) if (Z_TYPE_PP(t_ns) == IS_STRING && Z_TYPE_PP(t_code) == IS_STRING) { fault_code_ns = Z_STRVAL_PP(t_ns); fault_code = Z_STRVAL_PP(t_code); - fault_code_len = Z_STRLEN_PP(t_code); + fault_code_len = Z_STRSIZE_PP(t_code); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code"); return; @@ -927,7 +927,7 @@ PHP_METHOD(SoapFault, __toString) len = spprintf(&str, 0, "SoapFault exception: [%s] %s in %s:%ld\nStack trace:\n%s", Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_LVAL_P(line), - Z_STRLEN_P(trace) ? Z_STRVAL_P(trace) : "#0 {main}\n"); + Z_STRSIZE_P(trace) ? Z_STRVAL_P(trace) : "#0 {main}\n"); zval_ptr_dtor(&trace); @@ -941,9 +941,9 @@ PHP_METHOD(SoapVar, SoapVar) { zval *data, *type; char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL; - int stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0; + zend_str_size_int stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|SSSS", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) { return; } @@ -1002,8 +1002,8 @@ static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht TSRMLS_DC) zend_hash_internal_pointer_reset_ex(ht2, &pos2); while (zend_hash_get_current_data_ex(ht2, (void**)&tmp, &pos2) == SUCCESS) { char *name = NULL; - unsigned int name_len; - ulong index; + zend_str_size_uint name_len; + php_uint_t index; zend_hash_get_current_key_ex(ht2, &name, &name_len, &index, 0, &pos2); if (name) { @@ -1103,7 +1103,7 @@ PHP_METHOD(SoapServer, SoapServer) zval *wsdl = NULL, *options = NULL; int ret; int version = SOAP_1_1; - long cache_wsdl; + php_int_t cache_wsdl; HashTable *typemap_ht = NULL; SOAP_SERVER_BEGIN_CODE(); @@ -1137,14 +1137,14 @@ PHP_METHOD(SoapServer, SoapServer) if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } else if (Z_TYPE_P(wsdl) == IS_NULL) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode"); } if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); } if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS && @@ -1228,13 +1228,13 @@ PHP_METHOD(SoapServer, SoapServer) PHP_METHOD(SoapServer, setPersistence) { soapServicePtr service; - long value; + php_int_t value; SOAP_SERVER_BEGIN_CODE(); FETCH_THIS_SERVICE(service); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) != FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &value) != FAILURE) { if (service->type == SOAP_CLASS) { if (value == SOAP_PERSISTENCE_SESSION || value == SOAP_PERSISTENCE_REQUEST) { @@ -1262,14 +1262,15 @@ PHP_METHOD(SoapServer, setClass) char *classname; zend_class_entry **ce; - int classname_len, found, num_args = 0; + zend_str_size_int classname_len; + int found, num_args = 0; zval ***argv = NULL; SOAP_SERVER_BEGIN_CODE(); FETCH_THIS_SERVICE(service); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s*", &classname, &classname_len, &argv, &num_args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S*", &classname, &classname_len, &argv, &num_args) == FAILURE) { return; } @@ -1416,7 +1417,7 @@ PHP_METHOD(SoapServer, addFunction) return; } - key_len = Z_STRLEN_PP(tmp_function); + key_len = Z_STRSIZE_PP(tmp_function); key = emalloc(key_len + 1); zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len); @@ -1438,7 +1439,7 @@ PHP_METHOD(SoapServer, addFunction) int key_len; zend_function *f; - key_len = Z_STRLEN_P(function_name); + key_len = Z_STRSIZE_P(function_name); key = emalloc(key_len + 1); zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len); @@ -1491,7 +1492,7 @@ PHP_METHOD(SoapServer, handle) soapHeader *soap_headers = NULL; sdlFunctionPtr function; char *arg = NULL; - int arg_len = 0; + zend_str_size_int arg_len = 0; xmlCharEncodingHandlerPtr old_encoding; HashTable *old_class_map, *old_typemap; int old_features; @@ -1501,7 +1502,7 @@ PHP_METHOD(SoapServer, handle) FETCH_THIS_SERVICE(service); SOAP_GLOBAL(soap_version) = service->version; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &arg, &arg_len) == FAILURE) { return; } @@ -1779,8 +1780,8 @@ PHP_METHOD(SoapServer, handle) } } #endif - fn_name = estrndup(Z_STRVAL(h->function_name),Z_STRLEN(h->function_name)); - if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(h->function_name)), Z_STRLEN(h->function_name) + 1) || + fn_name = estrndup(Z_STRVAL(h->function_name),Z_STRSIZE(h->function_name)); + if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRSIZE(h->function_name)), Z_STRSIZE(h->function_name) + 1) || ((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) && zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) { if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) { @@ -1828,8 +1829,8 @@ PHP_METHOD(SoapServer, handle) } } - fn_name = estrndup(Z_STRVAL(function_name),Z_STRLEN(function_name)); - if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(function_name)), Z_STRLEN(function_name) + 1) || + fn_name = estrndup(Z_STRVAL(function_name),Z_STRSIZE(function_name)); + if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRSIZE(function_name)), Z_STRSIZE(function_name) + 1) || ((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) && zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) { if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) { @@ -1884,9 +1885,9 @@ PHP_METHOD(SoapServer, handle) if (function && function->responseName) { response_name = estrdup(function->responseName); } else { - response_name = emalloc(Z_STRLEN(function_name) + sizeof("Response")); - memcpy(response_name,Z_STRVAL(function_name),Z_STRLEN(function_name)); - memcpy(response_name+Z_STRLEN(function_name),"Response",sizeof("Response")); + response_name = emalloc(Z_STRSIZE(function_name) + sizeof("Response")); + memcpy(response_name,Z_STRVAL(function_name),Z_STRSIZE(function_name)); + memcpy(response_name+Z_STRSIZE(function_name),"Response",sizeof("Response")); } doc_return = serialize_response_call(function, response_name, service->uri, retval, soap_headers, soap_version TSRMLS_CC); efree(response_name); @@ -1992,7 +1993,7 @@ fail: PHP_METHOD(SoapServer, fault) { char *code, *string, *actor=NULL, *name=NULL; - int code_len, string_len, actor_len = 0, name_len = 0; + zend_str_size_int code_len, string_len, actor_len = 0, name_len = 0; zval* details = NULL; soapServicePtr service; xmlCharEncodingHandlerPtr old_encoding; @@ -2002,7 +2003,7 @@ PHP_METHOD(SoapServer, fault) old_encoding = SOAP_GLOBAL(encoding); SOAP_GLOBAL(encoding) = service->encoding; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|szs", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|SzS", &code, &code_len, &string, &string_len, &actor, &actor_len, &details, &name, &name_len) == FAILURE) { return; @@ -2319,7 +2320,7 @@ PHP_METHOD(SoapClient, SoapClient) zval *wsdl, *options = NULL; int soap_version = SOAP_1_1; php_stream_context *context = NULL; - long cache_wsdl; + php_int_t cache_wsdl; sdlPtr sdl = NULL; HashTable *typemap_ht = NULL; @@ -2343,7 +2344,7 @@ PHP_METHOD(SoapClient, SoapClient) /* Fetching non-WSDL mode options */ if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "uri", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "uri", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } else { php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode"); } @@ -2369,7 +2370,7 @@ PHP_METHOD(SoapClient, SoapClient) if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "location", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "location", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } else if (Z_TYPE_P(wsdl) == IS_NULL) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' option is required in nonWSDL mode"); } @@ -2382,10 +2383,10 @@ PHP_METHOD(SoapClient, SoapClient) } if (zend_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "_login", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); if (zend_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "_password", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } if (zend_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG && @@ -2395,17 +2396,17 @@ PHP_METHOD(SoapClient, SoapClient) } if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_proxy_host", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "_proxy_host", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS) { convert_to_long(*tmp); add_property_long(this_ptr, "_proxy_port", Z_LVAL_PP(tmp)); } if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_proxy_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "_proxy_login", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); if (zend_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_proxy_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "_proxy_password", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } } } @@ -2450,7 +2451,7 @@ PHP_METHOD(SoapClient, SoapClient) php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_PP(tmp)); } else { xmlCharEncCloseFunc(encoding); - add_property_stringl(this_ptr, "_encoding", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "_encoding", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } } if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS && @@ -2493,7 +2494,7 @@ PHP_METHOD(SoapClient, SoapClient) if (zend_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - add_property_stringl(this_ptr, "_user_agent", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + add_property_stringl(this_ptr, "_user_agent", Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } if (zend_hash_find(ht, "keep_alive", sizeof("keep_alive"), (void**)&tmp) == SUCCESS && @@ -2598,7 +2599,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act ret = FALSE; } else if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRLEN_P(response), 1); + add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRSIZE_P(response), 1); } xmlFree(buf); if (ret && zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) { @@ -2719,7 +2720,7 @@ static void do_soap_call(zval* this_ptr, if (ret && Z_TYPE(response) == IS_STRING) { encode_reset_ns(); - ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers TSRMLS_CC); + ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRSIZE(response), fn, NULL, return_value, output_headers TSRMLS_CC); encode_finish(); } @@ -2764,7 +2765,7 @@ static void do_soap_call(zval* this_ptr, if (ret && Z_TYPE(response) == IS_STRING) { encode_reset_ns(); - ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers TSRMLS_CC); + ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRSIZE(response), NULL, function, return_value, output_headers TSRMLS_CC); encode_finish(); } @@ -2832,7 +2833,8 @@ static void verify_soap_headers_array(HashTable *ht TSRMLS_DC) PHP_METHOD(SoapClient, __call) { char *function, *location=NULL, *soap_action = NULL, *uri = NULL; - int function_len, i = 0; + zend_str_size_int function_len; + int i = 0; HashTable* soap_headers = NULL; zval *options = NULL; zval *headers = NULL; @@ -2846,7 +2848,7 @@ PHP_METHOD(SoapClient, __call) HashPosition pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|a!zz", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sa|a!zz", &function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) { return; } @@ -3009,7 +3011,7 @@ PHP_METHOD(SoapClient, __getLastRequest) } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } RETURN_NULL(); } @@ -3027,7 +3029,7 @@ PHP_METHOD(SoapClient, __getLastResponse) } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } RETURN_NULL(); } @@ -3045,7 +3047,7 @@ PHP_METHOD(SoapClient, __getLastRequestHeaders) } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request_headers", sizeof("__last_request_headers"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } RETURN_NULL(); } @@ -3063,7 +3065,7 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders) } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response_headers", sizeof("__last_response_headers"), (void **)&tmp) == SUCCESS) { - RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } RETURN_NULL(); } @@ -3075,11 +3077,11 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders) PHP_METHOD(SoapClient, __doRequest) { char *buf, *location, *action; - int buf_size, location_size, action_size; - long version; - long one_way = 0; + zend_str_size_int buf_size, location_size, action_size; + php_int_t version; + php_int_t one_way = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl|l", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSSi|i", &buf, &buf_size, &location, &location_size, &action, &action_size, @@ -3094,7 +3096,7 @@ PHP_METHOD(SoapClient, __doRequest) RETURN_EMPTY_STRING(); } } else if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, - &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC)) { + &Z_STRVAL_P(return_value), &Z_STRSIZE_P(return_value) TSRMLS_CC)) { return_value->type = IS_STRING; return; } @@ -3110,10 +3112,10 @@ PHP_METHOD(SoapClient, __setCookie) { char *name; char *val = NULL; - int name_len, val_len = 0; + zend_str_size_int name_len, val_len = 0; zval **cookies; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len, &val, &val_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &name, &name_len, &val, &val_len) == FAILURE) { return; } @@ -3188,15 +3190,15 @@ PHP_METHOD(SoapClient, __setSoapHeaders) PHP_METHOD(SoapClient, __setLocation) { char *location = NULL; - int location_len = 0; + zend_str_size_int location_len = 0; zval **tmp; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &location, &location_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &location, &location_len) == FAILURE) { return; } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "location", sizeof("location"),(void **) &tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - RETVAL_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + RETVAL_STRINGL(Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), 1); } else { RETVAL_NULL(); } @@ -3617,7 +3619,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c smart_str_appends(&key, (char*)hdr_func->ns->href); smart_str_appendc(&key, ':'); } - smart_str_appendl(&key, Z_STRVAL(h->function_name), Z_STRLEN(h->function_name)); + smart_str_appendl(&key, Z_STRVAL(h->function_name), Z_STRSIZE(h->function_name)); smart_str_0(&key); if (zend_hash_find(fnb->input.headers, key.c, key.len+1, (void**)&hdr) == SUCCESS) { h->hdr = *hdr; @@ -3778,8 +3780,8 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(ret), &pos); while (zend_hash_get_current_data_ex(Z_ARRVAL_P(ret), (void **)&data, &pos) != FAILURE) { char *param_name = NULL; - unsigned int param_name_len; - ulong param_index = i; + zend_str_size_uint param_name_len; + php_uint_t param_index = i; zend_hash_get_current_key_ex(Z_ARRVAL_P(ret), &param_name, &param_name_len, &param_index, 0, &pos); parameter = get_param(function, param_name, param_index, TRUE); @@ -3863,13 +3865,13 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); smart_str_appendc(&key, ':'); hdr_ns = Z_STRVAL_PP(tmp); } if (zend_hash_find(ht, "name", sizeof("name"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); hdr_name = Z_STRVAL_PP(tmp); } smart_str_0(&key); @@ -3912,7 +3914,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function if (zend_hash_find(prop, "_name", sizeof("_name"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { sdlFaultPtr *tmp_fault; if (function && function->faults && - zend_hash_find(function->faults, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)+1, (void**)&tmp_fault) == SUCCESS) { + zend_hash_find(function->faults, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)+1, (void**)&tmp_fault) == SUCCESS) { fault = *tmp_fault; if (function->binding && function->binding->bindingType == BINDING_SOAP && @@ -3959,7 +3961,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { size_t new_len; xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode")); - char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); + char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); xmlAddChild(param, node); if (fault_ns) { xmlNsPtr nsptr = encode_add_ns(node, fault_ns); @@ -3984,7 +3986,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { size_t new_len; xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL); - char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); + char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL); if (fault_ns) { xmlNsPtr nsptr = encode_add_ns(node, fault_ns); @@ -4084,13 +4086,13 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function ht = Z_OBJPROP(h->retval); if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); smart_str_appendc(&key, ':'); hdr_ns = Z_STRVAL_PP(tmp); } if (zend_hash_find(ht, "name", sizeof("name"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { - smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRSIZE_PP(tmp)); hdr_name = Z_STRVAL_PP(tmp); } smart_str_0(&key); @@ -4314,9 +4316,9 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function smart_str key = {0}; sdlSoapBindingFunctionHeaderPtr *hdr; - smart_str_appendl(&key, Z_STRVAL_PP(ns), Z_STRLEN_PP(ns)); + smart_str_appendl(&key, Z_STRVAL_PP(ns), Z_STRSIZE_PP(ns)); smart_str_appendc(&key, ':'); - smart_str_appendl(&key, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); + smart_str_appendl(&key, Z_STRVAL_PP(name), Z_STRSIZE_PP(name)); smart_str_0(&key); if (zend_hash_find(hdrs, key.c, key.len+1,(void**)&hdr) == SUCCESS) { hdr_use = (*hdr)->use;
« previous php.cvs (#74165) next »