DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39813>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39813

           Summary: JMX proxy servlet newline escaping is incorrect
           Product: Tomcat 5
           Version: 5.5.17
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: trivial
          Priority: P4
         Component: Webapps:Manager
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


JMXProxyServlet.java at revision 411724.

Using MBean qry operation, if an attribute returns a String containing a
newline, the character before the newline is removed by the escape method (uses
idx-1 instead of idx on line 204).
e.g. PermGenStatus: Perm Gen : 19.93% (26739168/134217728\n

Furthermore, the end int is not checked to be > 0 in the appendHead method - so
anything starting with a newline would end up being a substring(0,-1) call (line
223) - resulting in an StringIndexOutOfBoundsException("String index out of
range: -1") which would then drop into "} catch (Exception e) {} // Ignore" in
listBeans causing any further attributes to not be printed out. 

Finally, the get operation does not use the escape method in getAttribute (line
114) so will print newlines. Guess this contravenes the JMX spec 1.2 - whose
changes log says "...the newline character ('\n') is forbidden everywhere. This
rule is new with 1.2."

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to