mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Backed out changeset 1835ac58c617 (bug 1656515) for multiple perma failures on Linux 18.04 x64 asan. CLOSED TREE
This commit is contained in:
parent
6fa43f1893
commit
656ca00b4c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user