mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-24 09:08:46 +01:00
Disable dnsjava hosts file parsing to fix NPE race condition.
This commit is contained in:
@@ -56,7 +56,11 @@ public class CustomDns implements Dns {
|
||||
|
||||
private static @NonNull Lookup doLookup(@NonNull String hostname) throws UnknownHostException {
|
||||
try {
|
||||
return new Lookup(hostname);
|
||||
Lookup lookup = new Lookup(hostname);
|
||||
// Disable hosts file lookups to work around a race condition in dnsjava 3.6.4's that leads to an NPE.
|
||||
// Android doesn't have a meaningful /etc/hosts anyway.
|
||||
lookup.setHostsFileParser(null);
|
||||
return lookup;
|
||||
} catch (Throwable e) {
|
||||
Log.w(TAG, e);
|
||||
throw new UnknownHostException();
|
||||
|
||||
Reference in New Issue
Block a user