Name: krC82822 Date: 04/20/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
FtpClient.login threw a StringIndexOutOfBoundsException whenever we tried to
login to a particular server. The server was sending a multi-line response of
the form:
230-1st line
other lines
230 last line
(as permitted by RFC959) and one of the "other lines" had **exactly 3**
characters.
An FTP client is supposed to read lines up to a line which contains a space
after the 230 code. Although the underlying
TransferProtocolClient.readServerResponse will read all the lines in,
FtpClient.login will only look at those lines up to a line which doesn't begin
with "230-", which isn't the same thing! This causes 3 problems:
(1) FtpClient.login will not store all of the lines into the welcomeMsg.
(2) It would be useful if FtpClient.login inserting '\n' between lines
concatenated into welcomeMsg.
(3) **The real problem** A 3-character line will result in an exception when it
attempts to compare the 4th character with "-".
(Review ID: 121110)
======================================================================