axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r382304 - /webservices/axis2/trunk/c/modules/core/transport/http/url.c
Date Thu, 02 Mar 2006 05:36:40 GMT
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;
 }
 



Mime
View raw message