mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1026022 - Check that string is UTF8. r=mcmanus
This commit is contained in:
parent
c7a48add8e
commit
59b9bc3637
@ -684,8 +684,12 @@ nsDNSService::AsyncResolve(const nsACString &hostname,
|
||||
nsresult rv;
|
||||
nsAutoCString hostACE;
|
||||
if (idn && !IsASCII(*hostPtr)) {
|
||||
if (NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE)))
|
||||
if (IsUTF8(*hostPtr) &&
|
||||
NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE))) {
|
||||
hostPtr = &hostACE;
|
||||
} else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
// make sure JS callers get notification on the main thread
|
||||
@ -747,8 +751,12 @@ nsDNSService::CancelAsyncResolve(const nsACString &aHostname,
|
||||
|
||||
nsAutoCString hostACE;
|
||||
if (idn && !IsASCII(aHostname)) {
|
||||
if (NS_SUCCEEDED(idn->ConvertUTF8toACE(aHostname, hostACE)))
|
||||
if (IsUTF8(aHostname) &&
|
||||
NS_SUCCEEDED(idn->ConvertUTF8toACE(aHostname, hostACE))) {
|
||||
hostname = hostACE;
|
||||
} else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t af = GetAFForLookup(hostname, aFlags);
|
||||
@ -794,8 +802,12 @@ nsDNSService::Resolve(const nsACString &hostname,
|
||||
nsresult rv;
|
||||
nsAutoCString hostACE;
|
||||
if (idn && !IsASCII(*hostPtr)) {
|
||||
if (NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE)))
|
||||
if (IsUTF8(*hostPtr) &&
|
||||
NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE))) {
|
||||
hostPtr = &hostACE;
|
||||
} else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user