Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8183705 | 8u161 | Unassigned | P5 | Resolved | Fixed | b01 |
JDK-8162964 | 8u152 | Svetlana Nikandrova | P5 | Resolved | Fixed | b01 |
JDK-8192441 | emb-8u161 | Unassigned | P5 | Resolved | Fixed | b01 |
JDK-8166473 | 7u131 | Ivan Gerasimov | P5 | Resolved | Fixed | b02 |
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
This is the original source code of the method sun.net.ftp.impl.FtpClient#nameList():
/**
* Issues a NLST path command to server to get the specified directory
* content. It differs from {@link #list(String)} method by the fact that
* it will only list the file names which would make the parsing of the
* somewhat easier.
*
* {@link #completePending()} <b>has</b> to be called once the application
* is finished writing to the stream.
*
* @param path a <code>String</code> containing the pathname of the
* directory to list or <code>null</code> for the current working
* directory.
* @return the <code>InputStream</code> from the resulting data connection
* @throws IOException if an error occurs during the transmission.
*/
public InputStream nameList(String path) throws sun.net.ftp.FtpProtocolException, IOException {
Socket s;
s = openDataConnection( " NLST " + path);
if (s != null) {
return createInputStream(s.getInputStream());
}
return null;
}
As can be seen, there is no handling of a null as the path parameter in this code at all (although documented).
A null as path doesn't lead to the expected result.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Passing an empty String instead of a null as the method argument.
A DESCRIPTION OF THE PROBLEM :
This is the original source code of the method sun.net.ftp.impl.FtpClient#nameList():
/**
* Issues a NLST path command to server to get the specified directory
* content. It differs from {@link #list(String)} method by the fact that
* it will only list the file names which would make the parsing of the
* somewhat easier.
*
* {@link #completePending()} <b>has</b> to be called once the application
* is finished writing to the stream.
*
* @param path a <code>String</code> containing the pathname of the
* directory to list or <code>null</code> for the current working
* directory.
* @return the <code>InputStream</code> from the resulting data connection
* @throws IOException if an error occurs during the transmission.
*/
public InputStream nameList(String path) throws sun.net.ftp.FtpProtocolException, IOException {
Socket s;
s = openDataConnection( " NLST " + path);
if (s != null) {
return createInputStream(s.getInputStream());
}
return null;
}
As can be seen, there is no handling of a null as the path parameter in this code at all (although documented).
A null as path doesn't lead to the expected result.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Passing an empty String instead of a null as the method argument.
- backported by
-
JDK-8162964 sun.net.ftp.impl.FtpClient.nameList(String path) handles "null" incorrectly
-
- Resolved
-
-
JDK-8163297 sun.net.ftp.impl.FtpClient.nameList(String path) handles "null" incorrectly
-
- Resolved
-
-
JDK-8166473 sun.net.ftp.impl.FtpClient.nameList(String path) handles "null" incorrectly
-
- Resolved
-
-
JDK-8183705 sun.net.ftp.impl.FtpClient.nameList(String path) handles "null" incorrectly
-
- Resolved
-
-
JDK-8192441 sun.net.ftp.impl.FtpClient.nameList(String path) handles "null" incorrectly
-
- Resolved
-