[JSch-users] bug in Sftp (and SftPubKey)
Status: Alpha
Brought to you by:
ymnk
From: Graeme V. <Gra...@nt...> - 2003-02-07 17:41:01
|
The commands in Sftp.java are read in using: InputStream.read() This is only OK is the input is a tty. If stdin is a file (for example a here document) it will read 1024 bytes and get a corrupt command. The minimal change is: BufferedReader in_rdr = new BufferedReader(new InputStreamReader(in)); ... strbuf=in_rdr.ReadLine(); i=strbuf.length(); buf=strbuf.getBytes(); However a better approach might be to use StringBuffer rather than byte arrays. -- Graeme The contents of this email and any attachments are sent for the personal attention of the addressee(s) only and may be confidential. If you are not the intended addressee, any use, disclosure or copying of this email and any attachments is unauthorised - please notify the sender by return and delete the message. Any representations or commitments expressed in this email are subject to contract. ntl Group Limited |