mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 426060: handle the possibility that both mHostRecord->addr_info and mHostRecord->addr are null if the old mHostRecord->addr_info exired and our attempt to reresolve it failed. r=jst, sr=cbiesinger blocking1.9+ Modified Files: nsDNSService2.cpp nsHostResolver.cpp
This commit is contained in:
parent
1772193496
commit
d68f1edbec
@ -137,7 +137,12 @@ nsDNSRecord::GetNextAddr(PRUint16 port, PRNetAddr *addr)
|
||||
}
|
||||
else {
|
||||
PR_Unlock(mHostRecord->addr_info_lock);
|
||||
NS_ASSERTION(mHostRecord->addr, "no addr");
|
||||
if (!mHostRecord->addr) {
|
||||
// Both mHostRecord->addr_info and mHostRecord->addr are null.
|
||||
// This can happen if mHostRecord->addr_info expired and the
|
||||
// attempt to reresolve it failed.
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
memcpy(addr, mHostRecord->addr, sizeof(PRNetAddr));
|
||||
// set given port
|
||||
port = PR_htons(port);
|
||||
|
@ -637,7 +637,9 @@ nsHostResolver::OnLookupComplete(nsHostRecord *rec, nsresult status, PRAddrInfo
|
||||
PR_Unlock(rec->addr_info_lock);
|
||||
if (old_addr_info)
|
||||
PR_FreeAddrInfo(old_addr_info);
|
||||
rec->expiration = NowInMinutes() + mMaxCacheLifetime;
|
||||
rec->expiration = NowInMinutes();
|
||||
if (result)
|
||||
rec->expiration += mMaxCacheLifetime;
|
||||
rec->resolving = PR_FALSE;
|
||||
|
||||
if (rec->addr_info && !mShutdown) {
|
||||
|
Loading…
Reference in New Issue
Block a user