Bug 1295103 - Check OriginAttributes::PopulateFromSuffix return value in DOMStorageDBThread r=honzab
MozReview-Commit-ID: FSIgxWNf9s4
--- a/dom/storage/DOMStorageDBThread.cpp
+++ b/dom/storage/DOMStorageDBThread.cpp
@@ -50,17 +50,18 @@ nsCString
Scheme0Scope(DOMStorageCacheBridge* aCache)
{
nsCString result;
nsCString suffix = aCache->OriginSuffix();
PrincipalOriginAttributes oa;
if (!suffix.IsEmpty()) {
- oa.PopulateFromSuffix(suffix);
+ DebugOnly<bool> success = oa.PopulateFromSuffix(suffix);
+ MOZ_ASSERT(success);
}
if (oa.mAppId != nsIScriptSecurityManager::NO_APP_ID || oa.mInIsolatedMozBrowser) {
result.AppendInt(oa.mAppId);
result.Append(':');
result.Append(oa.mInIsolatedMozBrowser ? 't' : 'f');
result.Append(':');
}
@@ -758,17 +759,18 @@ OriginAttrsPatternMatchSQLFunction::OnFu
{
nsresult rv;
nsAutoCString suffix;
rv = aFunctionArguments->GetUTF8String(0, suffix);
NS_ENSURE_SUCCESS(rv, rv);
PrincipalOriginAttributes oa;
- oa.PopulateFromSuffix(suffix);
+ bool success = oa.PopulateFromSuffix(suffix);
+ NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
bool result = mPattern.Matches(oa);
RefPtr<nsVariant> outVar(new nsVariant());
rv = outVar->SetAsBool(result);
NS_ENSURE_SUCCESS(rv, rv);
outVar.forget(aResult);
return NS_OK;