You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/03/02 06:36:40 UTC
svn commit: r382304 -
/webservices/axis2/trunk/c/modules/core/transport/http/url.c
Author: sahan
Date: Wed Mar 1 21:36:28 2006
New Revision: 382304
URL: http://svn.apache.org/viewcvs?rev=382304&view=rev
Log:
Fixed a memory corrupt - not taking the length of the serialized url correctly
Modified:
webservices/axis2/trunk/c/modules/core/transport/http/url.c
Modified: webservices/axis2/trunk/c/modules/core/transport/http/url.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/url.c?rev=382304&r1=382303&r2=382304&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/url.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/url.c Wed Mar 1 21:36:28 2006
@@ -293,15 +293,17 @@
axis2_url_impl_t *url_impl = NULL;
axis2_char_t *external_form = NULL;
axis2_ssize_t len = 0;
+ axis2_char_t port_str[8];
AXIS2_ENV_CHECK(env, NULL);
url_impl = AXIS2_INTF_TO_IMPL(url);
+ sprintf(port_str, "%d", url_impl->port);
len = AXIS2_STRLEN(url_impl->protocol) +
AXIS2_STRLEN(url_impl->server) + AXIS2_STRLEN(url_impl->path) +
- 7; /* port number is maximum 5 digits */
+ strlen(port_str) + 7;
external_form = (axis2_char_t*) AXIS2_MALLOC((*env)->allocator,
len);
- sprintf(external_form, "%s://%s:%d%s", url_impl->protocol, url_impl->server,
- url_impl->port, url_impl->path);
+ sprintf(external_form, "%s://%s:%s%s", url_impl->protocol, url_impl->server,
+ port_str, url_impl->path);
return external_form;
}