Bug 870652 - Add null ptr check in nsDNSRecord::ReportUnusable to avoid crashing r=mcmanus
authorSteve Workman <sworkman@mozilla.com>
Tue, 14 May 2013 16:35:18 -0700
changeset 131947 1be2d9024641e4272e6c155e115f0636139c6e9b
parent 131946 c4f374baea0ab471d360493da85051f3920e5696
child 131948 d63027c3baa8caba04384b56d41293e61b1ebc1e
push id24678
push userryanvm@gmail.com
push dateThu, 16 May 2013 01:15:09 +0000
treeherdermozilla-central@19cc1efe8097 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs870652
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 870652 - Add null ptr check in nsDNSRecord::ReportUnusable to avoid crashing r=mcmanus
netwerk/dns/nsDNSService2.cpp
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -226,17 +226,18 @@ nsDNSRecord::ReportUnusable(uint16_t aPo
 
     MutexAutoLock lock(mHostRecord->addr_info_lock);
 
     // Check that we are using a real addr_info (as opposed to a single
     // constant address), and that the generation count is valid. Otherwise,
     // ignore the report.
 
     if (mHostRecord->addr_info &&
-        mIterGenCnt == mHostRecord->addr_info_gencnt) {
+        mIterGenCnt == mHostRecord->addr_info_gencnt &&
+        mIter) {
         mHostRecord->ReportUnusable(&mIter->mAddress);
     }
 
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------