[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mina-dev
Subject:    [jira] [Created] (FTPSERVER-415) NPE in PassivePorts(int[]
From:       "Sebb (JIRA)" <jira () apache ! org>
Date:       2011-05-31 15:42:47
Message-ID: 811816137.56372.1306856567369.JavaMail.tomcat () hel ! zones ! apache ! org
[Download RAW message or body]

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


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic