You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "James G (Created) (JIRA)" <de...@myfaces.apache.org> on 2012/02/24 21:23:48 UTC

[jira] [Created] (MYFACES-3476) New CDATA fast filter throws Exception

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

        

[jira] [Resolved] (MYFACES-3476) New CDATA fast filter throws Exception

Posted by "Leonardo Uribe (Resolved) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3476.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.7
                   2.0.13
         Assignee: Leonardo Uribe

Thanks to James G for provide this patch
                
> 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
>            Assignee: Leonardo Uribe
>            Priority: Critical
>             Fix For: 2.0.13, 2.1.7
>
>
> 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