You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Stan Lewis (JIRA)" <ji...@apache.org> on 2010/04/26 19:55:31 UTC

[jira] Created: (CXF-2785) Base64Utils.decode should handle/wrap all exception types.

Base64Utils.decode should handle/wrap all exception types.
----------------------------------------------------------

                 Key: CXF-2785
                 URL: https://issues.apache.org/jira/browse/CXF-2785
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.2.6
            Reporter: Stan Lewis
         Attachments: patch.txt

Currently if you pass an invalid base64 encoded string to Base64Utils.decode() you can get various kinds of errors, as the code only catches at most IOException and converts that to a Base64Exception.  Should really catch Exception and log it appropriately to avoid seeing errors at runtime like this:

java.lang.ArrayIndexOutOfBoundsException: 8
        at org.apache.cxf.common.util.Base64Utility.processEncodeme(Base64Utility.java:345)
        at org.apache.cxf.common.util.Base64Utility.decodeChunk(Base64Utility.java:164)
        at org.apache.cxf.common.util.Base64Utility.decode(Base64Utility.java:180)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.setHeaders(AbstractHTTPDestination.java:147)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:333)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:270)
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
        at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
...

The attached patch does this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2785) Base64Utils.decode should handle/wrap all exception types.

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CXF-2785.
-------------------------------

    Fix Version/s: 2.3
                   2.2.8
       Resolution: Fixed

Applied patch with thanks to Stan.

> Base64Utils.decode should handle/wrap all exception types.
> ----------------------------------------------------------
>
>                 Key: CXF-2785
>                 URL: https://issues.apache.org/jira/browse/CXF-2785
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.6
>            Reporter: Stan Lewis
>            Assignee: Willem Jiang
>             Fix For: 2.3, 2.2.8
>
>         Attachments: patch.txt
>
>
> Currently if you pass an invalid base64 encoded string to Base64Utils.decode() you can get various kinds of errors, as the code only catches at most IOException and converts that to a Base64Exception.  Should really catch Exception and log it appropriately to avoid seeing errors at runtime like this:
> java.lang.ArrayIndexOutOfBoundsException: 8
>         at org.apache.cxf.common.util.Base64Utility.processEncodeme(Base64Utility.java:345)
>         at org.apache.cxf.common.util.Base64Utility.decodeChunk(Base64Utility.java:164)
>         at org.apache.cxf.common.util.Base64Utility.decode(Base64Utility.java:180)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setHeaders(AbstractHTTPDestination.java:147)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:333)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:270)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> ...
> The attached patch does this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-2785) Base64Utils.decode should handle/wrap all exception types.

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CXF-2785:
---------------------------------

    Assignee: Willem Jiang

> Base64Utils.decode should handle/wrap all exception types.
> ----------------------------------------------------------
>
>                 Key: CXF-2785
>                 URL: https://issues.apache.org/jira/browse/CXF-2785
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.6
>            Reporter: Stan Lewis
>            Assignee: Willem Jiang
>         Attachments: patch.txt
>
>
> Currently if you pass an invalid base64 encoded string to Base64Utils.decode() you can get various kinds of errors, as the code only catches at most IOException and converts that to a Base64Exception.  Should really catch Exception and log it appropriately to avoid seeing errors at runtime like this:
> java.lang.ArrayIndexOutOfBoundsException: 8
>         at org.apache.cxf.common.util.Base64Utility.processEncodeme(Base64Utility.java:345)
>         at org.apache.cxf.common.util.Base64Utility.decodeChunk(Base64Utility.java:164)
>         at org.apache.cxf.common.util.Base64Utility.decode(Base64Utility.java:180)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setHeaders(AbstractHTTPDestination.java:147)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:333)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:270)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> ...
> The attached patch does this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2785) Base64Utils.decode should handle/wrap all exception types.

Posted by "Stan Lewis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stan Lewis updated CXF-2785:
----------------------------

    Attachment: patch.txt

> Base64Utils.decode should handle/wrap all exception types.
> ----------------------------------------------------------
>
>                 Key: CXF-2785
>                 URL: https://issues.apache.org/jira/browse/CXF-2785
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.6
>            Reporter: Stan Lewis
>         Attachments: patch.txt
>
>
> Currently if you pass an invalid base64 encoded string to Base64Utils.decode() you can get various kinds of errors, as the code only catches at most IOException and converts that to a Base64Exception.  Should really catch Exception and log it appropriately to avoid seeing errors at runtime like this:
> java.lang.ArrayIndexOutOfBoundsException: 8
>         at org.apache.cxf.common.util.Base64Utility.processEncodeme(Base64Utility.java:345)
>         at org.apache.cxf.common.util.Base64Utility.decodeChunk(Base64Utility.java:164)
>         at org.apache.cxf.common.util.Base64Utility.decode(Base64Utility.java:180)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setHeaders(AbstractHTTPDestination.java:147)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:333)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:270)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> ...
> The attached patch does this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2785) Base64Utils.decode should handle/wrap all exception types.

Posted by "Stan Lewis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stan Lewis updated CXF-2785:
----------------------------

    Attachment:     (was: patch.txt)

> Base64Utils.decode should handle/wrap all exception types.
> ----------------------------------------------------------
>
>                 Key: CXF-2785
>                 URL: https://issues.apache.org/jira/browse/CXF-2785
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.6
>            Reporter: Stan Lewis
>
> Currently if you pass an invalid base64 encoded string to Base64Utils.decode() you can get various kinds of errors, as the code only catches at most IOException and converts that to a Base64Exception.  Should really catch Exception and log it appropriately to avoid seeing errors at runtime like this:
> java.lang.ArrayIndexOutOfBoundsException: 8
>         at org.apache.cxf.common.util.Base64Utility.processEncodeme(Base64Utility.java:345)
>         at org.apache.cxf.common.util.Base64Utility.decodeChunk(Base64Utility.java:164)
>         at org.apache.cxf.common.util.Base64Utility.decode(Base64Utility.java:180)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setHeaders(AbstractHTTPDestination.java:147)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:333)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:270)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> ...
> The attached patch does this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2785) Base64Utils.decode should handle/wrap all exception types.

Posted by "Stan Lewis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stan Lewis updated CXF-2785:
----------------------------

    Attachment: patch.txt

> Base64Utils.decode should handle/wrap all exception types.
> ----------------------------------------------------------
>
>                 Key: CXF-2785
>                 URL: https://issues.apache.org/jira/browse/CXF-2785
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.6
>            Reporter: Stan Lewis
>         Attachments: patch.txt
>
>
> Currently if you pass an invalid base64 encoded string to Base64Utils.decode() you can get various kinds of errors, as the code only catches at most IOException and converts that to a Base64Exception.  Should really catch Exception and log it appropriately to avoid seeing errors at runtime like this:
> java.lang.ArrayIndexOutOfBoundsException: 8
>         at org.apache.cxf.common.util.Base64Utility.processEncodeme(Base64Utility.java:345)
>         at org.apache.cxf.common.util.Base64Utility.decodeChunk(Base64Utility.java:164)
>         at org.apache.cxf.common.util.Base64Utility.decode(Base64Utility.java:180)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setHeaders(AbstractHTTPDestination.java:147)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:333)
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:270)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
>         at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> ...
> The attached patch does this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.