#14 NumberFormatExcetion thrown in SshIO

open
nobody
None
5
2002-12-18
2002-12-18
Anonymous
No

In the SshIO.java, when the protocol negotiation is done
( both sides sending an identification string )

if (!idstr.substring(0,4).equals("SSH-")) {
System.out.println("Received invalid ID
string: " +idstr+", (substr "+idstr.substring(0,4)+")");
throw (new IOException());
}
remotemajor = Integer.parseInt
(idstr.substring(4,5));
remoteminor = Integer.parseInt
(idstr.substring(6,8));

extracting the remote minor throws
NumberFormatException, when minor version is a single
digit, for eg:- "SSH-1.5"

Discussion