summaryrefslogtreecommitdiffstats
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2015-06-25 15:51:41 -0700
committerDmitriy Ivanov <dimitry@google.com>2015-06-25 17:03:26 -0700
commit06700b2b5e92a365505b15d0d05e2d5b0706c511 (patch)
tree5a87677b9410084999068396360f892ef8d837b2 /linker/linker.cpp
parentfb3357e2eb9366d87a8da96e1a0744c9b1f22af9 (diff)
downloadbionic-06700b2b5e92a365505b15d0d05e2d5b0706c511.zip
bionic-06700b2b5e92a365505b15d0d05e2d5b0706c511.tar.gz
bionic-06700b2b5e92a365505b15d0d05e2d5b0706c511.tar.bz2
Fix crash when trying to load invalid ELF file.
Bug: http://b/22047255 Bug: http://b/22091640 Change-Id: I6c51cff43287a6ac4b25fa9ce6a6fc3d232fd047
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index e147a13..e1b8ca9 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -1293,7 +1293,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;
}