You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Niklas Gustavsson (JIRA)" <ji...@apache.org> on 2011/06/01 15:09:47 UTC

[jira] [Closed] (FTPSERVER-415) NPE in PassivePorts(int[] passivePorts, boolean checkIfBound) constructor

     [ 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