Issue Details (XML | Word | Printable)

Key: NET-59
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Christian Hufgard
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

[net] NullpointerException on FTPClient.disconnect() if an Exception occured while FTPClient.connect

Created: 02/Jun/05 09:41 PM   Updated: 20/Dec/06 11:01 AM
Return to search
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 2.0

Time Tracking:
Not Specified

Environment:
Operating System: All
Platform: Other

Bugzilla Id: 35185
Resolution Date: 20/Dec/06 11:01 AM


 Description  « Hide
Hello,

think this bug is the same (or at least similiar) to the following one:
http://issues.apache.org/bugzilla/show_bug.cgi?id=26296
but since I was not sure, I opened it as a seperate report.

Versions affected: commons-net-1.2.2, think also commons-net-1.4.0

Problem: If an exception occures while FTPClient.connect() is running, a call to
FTPClient.disconnect() in a finally-block might throw a NullPointerException.
I am pretty shure, that this might cause some Threads so keep alive, also they
cannot be interrupted anymore.

Reason: This happens since TelnetClient.disconnect() does not check whether the
Streams (__input and __ouput) it tries to close are NULL or not.
Normally it is sufficent to check FTPClient.isConnected(), but if a exceptions
is thrown after SocketClient._connectAction has been excecuted, SocketClient.
isConnected is set to true, so the check will indicate that the connection is
alive.

Christian



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.