mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niklas Gustavsson (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (FTPSERVER-415) NPE in PassivePorts(int[] passivePorts, boolean checkIfBound) constructor
Date Wed, 01 Jun 2011 13:09:47 GMT

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

Niklas Gustavsson closed FTPSERVER-415.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.0
                   1.0.6
         Assignee: Niklas Gustavsson

This has been reported before, so about time we do something about it. Passing null should
not be allowed. I've added an explicit null check to make this clear. Committed in rev 1130138
and 1130141.

> NPE in PassivePorts(int[] passivePorts, boolean checkIfBound) constructor
> -------------------------------------------------------------------------
>
>                 Key: FTPSERVER-415
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-415
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Core
>            Reporter: Sebb
>            Assignee: Niklas Gustavsson
>             Fix For: 1.0.6, 1.1.0
>
>
> The PassivePorts(int[] passivePorts, boolean checkIfBound) constructor allows passivePorts
to be null, but then uses it to create the parallel reservedPorts list:
>         if (passivePorts != null) {
>             this.passivePorts = passivePorts.clone();
>         } else {
>             this.passivePorts = null; // sets field to null
>         }
>         reservedPorts = new boolean[passivePorts.length]; // <= possible NPE here
> If null is really allowed as a parameter, it should be handled properly.
> Either set reservedPorts to null as well, or (perhaps safer) create an empty passivePorts
array (and empty reservedPorts array).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message