diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 4f6476bba8..516261fa22 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -2607,8 +2607,16 @@ nsCookieService::Read() if (!hasResult) break; - // Make sure we haven't already read the data. - stmt->GetUTF8String(IDX_BASE_DOMAIN, baseDomain); + // IDX_BASE_DOMAIN cannot be used, because updates to the public suffix list + // may invalidate the value of the stored baseDomain. + stmt->GetUTF8String(IDX_HOST, host); + + rv = GetBaseDomainFromHost(host, baseDomain); + if (NS_FAILED(rv)) { + COOKIE_LOGSTRING(LogLevel::Debug, + ("Read(): Ignoring invalid host '%s'", host.get())); + continue; + } nsAutoCString suffix; NeckoOriginAttributes attrs;