Author: rjung Date: Thu Jan 3 03:07:07 2008 New Revision: 608449 URL: http://svn.apache.org/viewvc?rev=608449&view=rev Log: Fix BZ 44116: Handling of multiple JSESSIONID cookies.
Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=608449&r1=608448&r2=608449&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Thu Jan 3 03:07:07 2008 @@ -358,25 +358,27 @@ * Session cookie was found, get it's value */ char *id_end; + size_t sz; ++id_start; - id_start = jk_pool_strdup(s->pool, id_start); - if ((id_end = strchr(id_start, ';')) != NULL) { - *id_end = '\0'; - } - if ((id_end = strchr(id_start, ',')) != NULL) { - *id_end = '\0'; + if ((id_end = strpbrk(id_start, ";,")) != NULL) + sz = id_end - id_start; + else { + sz = strlen(id_start); + id_end = id_start + sz; } if (result == NULL) { - result = id_start; + result = jk_pool_alloc(s->pool, sz + 1); + memcpy(result, id_start, sz); + result[sz] = '\0'; } else { size_t osz = strlen(result) + 1; - size_t sz = osz + strlen(id_start) + 1; result = - jk_pool_realloc(s->pool, sz, result, osz); + jk_pool_realloc(s->pool, osz + sz + 1, result, osz); strcat(result, ";"); - strcat(result, id_start); + strncat(result, id_start, sz); } + id_start = id_end; } } } Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=608449&r1=608448&r2=608449&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Thu Jan 3 03:07:07 2008 @@ -44,7 +44,10 @@ <subsection name="Native"> <changelog> <fix> - Use thread safe localtime_r where appropriate. (rjung) + <bug>44116</bug>: Fix handling of multiple JSESSIONID cookies. (rjung) + </fix> + <fix> + <bug>37850</bug>: Use thread safe localtime_r where appropriate. (rjung) </fix> <fix> Use thread safe strtok_r on more platforms, especially AIX. (rjung) @@ -53,15 +56,16 @@ Status: Improve XSS hardening. (rjung) </update> <update> - Move initialization of service members with defaults from web server - specific code to our generic jk_init_ws_service() function. (rjung) + <bug>35303</bug>: Move initialization of service members with defaults from + web server specific code to our generic jk_init_ws_service() function. (rjung) </update> - <update> - Common: Add missing prepost cping/cpong directly after connect + <fix> + <bug>36385</bug>: Add missing prepost cping/cpong directly after connect in case prepost cping is used, but no connect cping. (rjung) - </update> + </fix> <update> - Apache: Enhance robustness of message formating in jk_error_exit(). (rjung) + <bug>37322</bug>: Apache: Enhance robustness of message formating + in jk_error_exit(). (rjung) </update> <fix> <bug>44147</bug>: Multiple load balancing workers problem. (rjung) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]