Skip to content

NullPointerException in HostsFileParser.getAddressForHost - hostsCache not initialized #400

@msimonides-proton

Description

@msimonides-proton

We've started seeing this exception in our product in the wild after updating from 3.6.2 to 3.6.4 . It looks like validateCache doesn't always initialize the hostsCache.
Could have been this commit 5609998 ?

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Map.get(java.lang.Object)' on a null object reference
    at org.xbill.DNS.hosts.HostsFileParser.getAddressForHost(HostsFileParser.java:111)
    at org.xbill.DNS.Lookup.lookupFromHostsFile(Lookup.java:649)
    at org.xbill.DNS.Lookup.lookup(Lookup.java:586)
    at org.xbill.DNS.Lookup.resolve(Lookup.java:675)
    at org.xbill.DNS.Lookup.run(Lookup.java:697)
    at ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-feedbackQuestion not answered or clarifying information missing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions