You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by jwagenleitner <gi...@git.apache.org> on 2017/02/19 00:26:08 UTC

[GitHub] groovy pull request #500: GROOVY-8056: GroovyCodeSource(URL) can leak a file...

GitHub user jwagenleitner opened a pull request:

    https://github.com/apache/groovy/pull/500

    GROOVY-8056: GroovyCodeSource(URL) can leak a file handler

    URLConnect.getContentEncoding returns the Content-Encoding
    HTTP Header [1] which is not a charset.  Since this method would
    have either returned null or an invalid charset, the code path
    specifying the encoding would normally not have been executed.
    The charset may be contained in the Content-Type header, but
    rather than attempt to parse that string which would require
    closing the connection, this fix avoids opening the connection
    and relies on the default charset.
    
    [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jwagenleitner/groovy groovy8056-content-encoding

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/500.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #500
    
----
commit 29a641ccc212d397bdc11d3a995763b88dfe34b5
Author: John Wagenleitner <jw...@apache.org>
Date:   2017-02-19T00:22:49Z

    GROOVY-8056: GroovyCodeSource(URL) can leak a file handler
    
    URLConnect.getContentEncoding returns the Content-Encoding
    HTTP Header [1] which is not a charset.  Since this method would
    have either returned null or an invalid charset, the code path
    specifying the encoding would normally not have been executed.
    The charset may be contained in the Content-Type header, but
    rather than attempt to parse that string which would require
    closing the connection, this fix avoids opening the connection
    and relies on the default charset.
    
    [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #500: GROOVY-8056: GroovyCodeSource(URL) can leak a file...

Posted by jwagenleitner <gi...@git.apache.org>.
Github user jwagenleitner closed the pull request at:

    https://github.com/apache/groovy/pull/500


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---