Fix crash when trying to load invalid ELF file.

Bug: http://b/22047255
Bug: http://b/22091640
Change-Id: I6c51cff43287a6ac4b25fa9ce6a6fc3d232fd047
(cherry picked from commit 06700b2b5e)
This commit is contained in:
Dmitriy Ivanov
2015-06-25 15:51:41 -07:00
parent d19c271599
commit 3f987f5b3e
3 changed files with 19 additions and 4 deletions

View File

@@ -1337,7 +1337,7 @@ static soinfo* load_library(int fd, off64_t file_offset,
}
// Read the ELF header and load the segments.
ElfReader elf_reader(realpath.c_str(), fd, file_offset);
ElfReader elf_reader(realpath.c_str(), fd, file_offset, file_stat.st_size);
if (!elf_reader.Load(extinfo)) {
return nullptr;
}