Bug 538930 - [@ @0x0 | nsNotifyAddrListener::Run] assumes InitIPHelperLibrary will never fail and that sNotifyAddrChange will be non null, r=biesi
authortimeless@mozdev.org
Mon, 11 Jan 2010 07:40:00 -0800
changeset 37462 afa33a4e60b12d36d82694bc14e1ae4086c57bd6
parent 37461 2efb8d57344a251824eba646f3949449d42fa760
child 37463 8d563161748b94276df43e0565928d460bcb77e9
push id11316
push userphilringnalda@gmail.com
push dateMon, 25 Jan 2010 04:22:59 +0000
treeherdermozilla-central@afa33a4e60b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbiesi
bugs538930
milestone1.9.3a1pre
Bug 538930 - [@ @0x0 | nsNotifyAddrListener::Run] assumes InitIPHelperLibrary will never fail and that sNotifyAddrChange will be non null, r=biesi
netwerk/system/win32/nsNotifyAddrListener.cpp
--- a/netwerk/system/win32/nsNotifyAddrListener.cpp
+++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
@@ -172,16 +172,21 @@ nsNotifyAddrListener::Run()
     NS_ENSURE_TRUE(ev, NS_ERROR_OUT_OF_MEMORY);
 
     HANDLE handles[2] = { ev, mShutdownEvent };
     OVERLAPPED overlapped = { 0 };
     PRBool shuttingDown = PR_FALSE;
 
     InitIPHelperLibrary();
 
+    if (!sNotifyAddrChange) {
+        CloseHandle(ev);
+        return NS_ERROR_NOT_AVAILABLE;
+    }
+
     overlapped.hEvent = ev;
     while (!shuttingDown) {
         HANDLE h;
         DWORD ret = sNotifyAddrChange(&h, &overlapped);
 
         if (ret == ERROR_IO_PENDING) {
             ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
             if (ret == WAIT_OBJECT_0) {