Skip to content

Commit

Permalink
Telnet: ensure port number is below maximum
Browse files Browse the repository at this point in the history
Closes #62
  • Loading branch information
kruton committed Apr 18, 2015
1 parent c37f46e commit 422b013
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
as a negative integer.
- DSA host key support was broken from the beginning of the v1.8 series.
- Connections would sometimes close when leaving ConnectBot.
- Telnet port range too high will no longer cause crashes.

### Added
- More context is given for failures to connect via SSH which should
Expand Down
4 changes: 2 additions & 2 deletions src/org/connectbot/transport/Telnet.java
Expand Up @@ -287,7 +287,7 @@ public HostBean createHost(Uri uri) {
host.setHostname(uri.getHost());

int port = uri.getPort();
if (port < 0)
if (port < 0 || port > 65535)
port = DEFAULT_PORT;
host.setPort(port);

Expand All @@ -309,7 +309,7 @@ public void getSelectionArgs(Uri uri, Map<String, String> selection) {
selection.put(HostDatabase.FIELD_HOST_HOSTNAME, uri.getHost());

int port = uri.getPort();
if (port < 0)
if (port < 0 || port > 65535)
port = DEFAULT_PORT;
selection.put(HostDatabase.FIELD_HOST_PORT, Integer.toString(port));
}
Expand Down

0 comments on commit 422b013

Please sign in to comment.