1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 18:29:45 +02:00

Fix OOB exception when setHostAddress(InetAddress) is used.

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  at java.lang.String.charAt(String.java:658)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:48)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:62)
This commit is contained in:
Florian Schmaus 2017-01-04 15:35:47 +01:00
parent 157ff138a4
commit e9bbe9a475
3 changed files with 12 additions and 9 deletions

View file

@ -593,6 +593,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
failedAddresses.add(hostAddress);
} else {
StringUtils.requireNotNullOrEmpty(host, "Host of HostAddress " + hostAddress + " must not be null when using a Proxy");
final String hostAndPort = host + " at port " + port;
LOGGER.finer("Trying to establish TCP connection via Proxy to " + hostAndPort);
try {