зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1111842 - Make sure QuotaManager can handle escaped URL components passed from SQLite, r=janv.
This commit is contained in:
Родитель
413e425bf2
Коммит
f2c0ff7d75
|
@ -42,6 +42,7 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsCRTGlue.h"
|
||||
#include "nsDirectoryServiceUtils.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsScriptSecurityManager.h"
|
||||
|
@ -1617,12 +1618,19 @@ QuotaManager::GetQuotaObject(PersistenceType aPersistenceType,
|
|||
fileSize = 0;
|
||||
}
|
||||
|
||||
// Re-escape our parameters above to make sure we get the right quota group.
|
||||
nsAutoCString tempStorage1;
|
||||
const nsCSubstring& group = NS_EscapeURL(aGroup, esc_Query, tempStorage1);
|
||||
|
||||
nsAutoCString tempStorage2;
|
||||
const nsCSubstring& origin = NS_EscapeURL(aOrigin, esc_Query, tempStorage2);
|
||||
|
||||
nsRefPtr<QuotaObject> result;
|
||||
{
|
||||
MutexAutoLock lock(mQuotaMutex);
|
||||
|
||||
GroupInfoTriple* triple;
|
||||
if (!mGroupInfoTriples.Get(aGroup, &triple)) {
|
||||
if (!mGroupInfoTriples.Get(group, &triple)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -1633,7 +1641,7 @@ QuotaManager::GetQuotaObject(PersistenceType aPersistenceType,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<OriginInfo> originInfo = groupInfo->LockedGetOriginInfo(aOrigin);
|
||||
nsRefPtr<OriginInfo> originInfo = groupInfo->LockedGetOriginInfo(origin);
|
||||
|
||||
if (!originInfo) {
|
||||
return nullptr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче