bug 1439340 - lock addr_info in nsHostRecord::RemoveOrRefresh r?valentin draft
authorDaniel Stenberg <daniel@haxx.se>
Mon, 19 Feb 2018 09:03:09 +0100
changeset 756956 27575ffc3ace060c8bc1ac5799b7d641f95f9522
parent 756852 ad133cd410a719c0b67e61b8d3b1c77a32fd80a9
push id99599
push userbmo:daniel@haxx.se
push dateMon, 19 Feb 2018 12:54:46 +0000
reviewersvalentin
bugs1439340
milestone60.0a1
bug 1439340 - lock addr_info in nsHostRecord::RemoveOrRefresh r?valentin MozReview-Commit-ID: 6h4Sk1NjAJT
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -471,16 +471,17 @@ nsHostRecord::GetPriority(uint16_t aFlag
 
 // Returns true if the entry can be removed, or false if it should be left.
 // Sets mResolveAgain true for entries being resolved right now.
 bool
 nsHostRecord::RemoveOrRefresh()
 {
     // no need to flush TRRed names, they're not resolved "locally"
     Cancel();
+    MutexAutoLock lock(addr_info_lock);
     if (addr_info && addr_info->IsTRR()) {
         return false;
     }
     if (mNative) {
         if (!onQueue) {
             // The request has been passed to the OS resolver. The resultant DNS
             // record should be considered stale and not trusted; set a flag to
             // ensure it is called again.