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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to