tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1196019 - /tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
Date Tue, 01 Nov 2011 14:33:15 GMT
Author: mturk
Date: Tue Nov  1 14:33:14 2011
New Revision: 1196019

URL: http://svn.apache.org/viewvc?rev=1196019&view=rev
Log:
Escaped uri can in theory have max 3 times the original size. No need for extra alloc

Modified:
    tomcat/jk/trunk/native/iis/jk_isapi_plugin.c

Modified: tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/iis/jk_isapi_plugin.c?rev=1196019&r1=1196018&r2=1196019&view=diff
==============================================================================
--- tomcat/jk/trunk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Tue Nov  1 14:33:14 2011
@@ -1998,7 +1998,7 @@ static DWORD handle_notify_event(PHTTP_F
             forwardURI = uri_undec;
         }
         else if (uri_select_option == URI_SELECT_OPT_ESCAPED) {
-            size_t elen  = strlen(uri) * 4;
+            size_t elen  = strlen(uri) * 3 + 1;
             char *escuri = jk_pool_alloc(&pool, elen);
             if (!escape_url(uri, escuri, (int)elen)) {
                 jk_log(logger, JK_LOG_ERROR,
@@ -2015,9 +2015,9 @@ static DWORD handle_notify_event(PHTTP_F
             forwardURI = escuri;
         }
         else if (uri_select_option == URI_SELECT_OPT_PROXY) {
-            size_t clen  = strlen(uri) * 4;
-            char *canuri = jk_pool_alloc(&pool, clen);
-            if (!jk_canonenc(uri, canuri, (int)clen)) {
+            size_t elen  = strlen(uri) * 3 + 1;
+            char *escuri = jk_pool_alloc(&pool, elen);
+            if (!jk_canonenc(uri, escuri, (int)elen)) {
                 jk_log(logger, JK_LOG_ERROR,
                        "[%s] re-encoding request exceeds maximum buffer size.",
                        uri);
@@ -2028,8 +2028,8 @@ static DWORD handle_notify_event(PHTTP_F
             if (JK_IS_DEBUG_LEVEL(logger))
                 jk_log(logger, JK_LOG_DEBUG,
                        "fowarding escaped URI [%s]",
-                       canuri);
-            forwardURI = canuri;
+                       escuri);
+            forwardURI = escuri;
         }
         else {
             forwardURI = uri;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message