tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r607931 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml
Date Tue, 01 Jan 2008 22:31:16 GMT
Author: rjung
Date: Tue Jan  1 14:31:15 2008
New Revision: 607931

URL: http://svn.apache.org/viewvc?rev=607931&view=rev
Log:
Enhance robustness of message formating in jk_error_exit().
The formatted string gets passed to ap_log_error() without futher
args, so we should ensure, there's no formatting character in it.

Modified:
    tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=607931&r1=607930&r2=607931&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Tue Jan  1 14:31:15 2008
@@ -542,10 +542,20 @@
 {
     va_list ap;
     char *res;
+    char *ch;
 
     va_start(ap, fmt);
     res = ap_pvsprintf(p, fmt, ap);
     va_end(ap);
+    /* Replace all format characters in the resulting message */
+    /* because we feed the message to ap_log_error(). */
+    ch = res;
+    while (*ch) {
+        if (*ch == '%') {
+            *ch = '#';
+        }
+        ch++;
+    }
 
     ap_log_error(file, line, level, s, res);
     if ( s ) {

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=607931&r1=607930&r2=607931&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Tue Jan  1 14:31:15 2008
@@ -575,10 +575,20 @@
 {
     va_list ap;
     char *res;
+    char *ch;
 
     va_start(ap, fmt);
     res = apr_pvsprintf(s->process->pool, fmt, ap);
     va_end(ap);
+    /* Replace all format characters in the resulting message */
+    /* because we feed the message to ap_log_error(). */
+    ch = res;
+    while (*ch) {
+        if (*ch == '%') {
+            *ch = '#';
+        }
+        ch++;
+    }
 
     ap_log_error(file, line, level, 0, s, res);
     if ( s ) {

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=607931&r1=607930&r2=607931&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Tue Jan  1 14:31:15 2008
@@ -43,6 +43,9 @@
   <br />
   <subsection name="Native">
     <changelog>
+      <update>
+        Apache: Enhance robustness of message formating in jk_error_exit(). (rjung)
+      </update>
       <fix>
         <bug>44147</bug>: Multiple load balancing workers problem. (rjung)
       </fix>



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


Mime
View raw message