mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Fix NPE in DNSResolver.lookupSRVRecords0
in case hostAddresses was null, the isEmpty() check before the log() invocation would throw an NPE. Thanks to Ingo Bauersachs for reporting this. Fixes SMACK-788.
This commit is contained in:
parent
be4aacc71d
commit
47940ba5ad
4 changed files with 21 additions and 24 deletions
|
@ -24,7 +24,6 @@ import java.util.Collections;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.jivesoftware.smack.ConnectionConfiguration.DnssecMode;
|
||||
import org.jivesoftware.smack.initializer.SmackInitializer;
|
||||
|
@ -91,13 +90,7 @@ public class MiniDnsResolver extends DNSResolver implements SmackInitializer {
|
|||
for (SRV srv : result.getAnswers()) {
|
||||
String hostname = srv.name.ace;
|
||||
List<InetAddress> hostAddresses = lookupHostAddress0(hostname, failedAddresses, dnssecMode);
|
||||
if (hostAddresses == null || hostAddresses.isEmpty()) {
|
||||
// If hostAddresses is not null but empty, then the DNS resolution was successful but the domain did not
|
||||
// have any A or AAAA resource records.
|
||||
if (hostAddresses.isEmpty()) {
|
||||
LOGGER.log(Level.INFO, "The DNS name " + name + ", points to a hostname (" + hostname
|
||||
+ ") which has neither A or AAAA resource records. This is an indication of a broken DNS setup.");
|
||||
}
|
||||
if (shouldContinue(name, hostname, hostAddresses)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue