Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.1k views
in Java FTP by
Hello,

in version 1.5.1 there is an unhandled null reply in FTPControlSocket.readReply(). If reader.readLine() returns null, the call of log(line, false) will fail with a NullPointerException:
     FTPReply readReply()
         throws IOException {
         
         String line = reader.readLine();
         while (line != null && line.length() == 0)
             line = reader.readLine();
                  
         log(line, false);
         
         if (line.length() < 3)
             throw new IOException("Short reply received");

However, this little patch will solve the problem, now the method throws a proper IOException.
RCS file: /EDTFTPJ/src/com/enterprisedt/net/ftp/FTPControlSocket.java,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 FTPControlSocket.java
642a643,645
>          if (line == null)
>              throw new IOException("Unexpected null reply received");
> 

1 Answer

0 votes
by (162k points)
Thanks for a useful fix - will be in 1.5.2

Categories

...