Backed out changeset 1835ac58c617 (bug 1656515) for multiple perma failures on Linux 18.04 x64 asan. CLOSED TREE

This commit is contained in:
Razvan Maries 2020-08-11 00:52:58 +03:00
parent 6fa43f1893
commit 656ca00b4c

View File

@ -297,24 +297,12 @@ static bool GetGREFileContents(const char* aFilePath, nsCString* aOutString) {
// Look for the requested file in omnijar.
RefPtr<CacheAwareZipReader> zip = Omnijar::GetReader(Omnijar::GRE);
if (zip) {
const auto item = zip->GetItem(aFilePath);
if (!item) {
uint32_t length;
const uint8_t* data = zip->GetData(aFilePath, &length);
if (!data) {
return false;
}
MOZ_ASSERT(item->RealSize());
auto data = MakeUnique<uint8_t>(item->RealSize());
CacheAwareZipCursor cursor(item, zip, data.get(), item->RealSize());
uint32_t count;
cursor.Read(&count);
if (count != item->RealSize()) {
return false;
}
aOutString->Assign(reinterpret_cast<const char*>(data.get()), count);
aOutString->Assign(reinterpret_cast<const char*>(data), length);
return true;
}