commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FILEUPLOAD-250) FileUploadBase - potential resource leak - InputStream not closed on exception
Date Mon, 17 Feb 2014 00:19:19 GMT

     [ https://issues.apache.org/jira/browse/FILEUPLOAD-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb resolved FILEUPLOAD-250.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 1.4

URL: http://svn.apache.org/r1568866
Log:
FILEUPLOAD-250 FileUploadBase - potential resource leak - InputStream not closed on exception

Modified:
    commons/proper/fileupload/trunk/src/changes/changes.xml
    commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/FileUploadBase.java


> FileUploadBase - potential resource leak - InputStream not closed on exception
> ------------------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-250
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-250
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Sebb
>             Fix For: 1.4
>
>
> FileUploadBase has several instances where the InputStream "input" is not closed when
an Exception is throw. This can potentially be a resource leak and is best avoided.
> The first case is easy to deal with, as the InputStream does not need to be created until
after the SizeLimitExceededException has been thrown.
> The next case occurs if the boundary is not found.
> This check could be moved to before the size check, however that would change the behaviour
slightly, as FileUploadException would be thrown instead of SizeLimitExceededException if
both boundary and size are wrong.
> The last case is where InvalidContentTypeException is thrown. This cannot easily be avoided.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message