New CDATA fast filter throws Exception
--------------------------------------

                 Key: MYFACES-3476
                 URL: https://issues.apache.org/jira/browse/MYFACES-3476
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-314
    Affects Versions: 2.0.12
         Environment: MyFaces 2.0.12, Richfaces 4.1.0.Final, Tomcat 6, Linux
            Reporter: James G
            Priority: Critical


When the filter (CDataEndEscapeFilterWriter) parses 2 CDATA End tags, it passes 
an incorrect length to the writer throwing an exception further down the stack. 
 The incorrect length comes from the method write(char[] cbuf, int off, int 
len).  On the second match of the end tag the (offset+length) passed to the 
super.write can be greater than the (offset+length) passed to the method.  
Suggested fix:
change index = i+1; to index = off+i+1; and
change super.write(cbuf, index, i+1);
to super.write(cbuf, index, i+1 - ( index - off ) );

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to