diff options
author | Christopher Ferris <cferris@google.com> | 2019-01-15 19:10:49 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2019-01-15 19:10:49 -0800 |
commit | 3e762cdabb9dae23605bf60db67e016f60490e45 (patch) | |
tree | 0155dd76d6205301e1be2aba8486836d4702f43e /libunwindstack/ElfInterface.cpp | |
parent | 28ad548ae5ad41b3ee1fa2ededab30fb5bcffc67 (diff) | |
download | unwinding-3e762cdabb9dae23605bf60db67e016f60490e45.tar.gz |
Fix usage of Read instead of ReadFully.
Found by inspection.
Test: Builds and unit tests passes.
Change-Id: I10b63534ae0a3bff9ce56e821c542fa69c15822d
Diffstat (limited to 'libunwindstack/ElfInterface.cpp')
-rw-r--r-- | libunwindstack/ElfInterface.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libunwindstack/ElfInterface.cpp b/libunwindstack/ElfInterface.cpp index d0af94a..709e6c9 100644 --- a/libunwindstack/ElfInterface.cpp +++ b/libunwindstack/ElfInterface.cpp @@ -177,14 +177,14 @@ bool ElfInterface::ReadAllHeaders(uint64_t* load_bias) { template <typename EhdrType, typename PhdrType> uint64_t ElfInterface::GetLoadBias(Memory* memory) { EhdrType ehdr; - if (!memory->Read(0, &ehdr, sizeof(ehdr))) { + if (!memory->ReadFully(0, &ehdr, sizeof(ehdr))) { return false; } uint64_t offset = ehdr.e_phoff; for (size_t i = 0; i < ehdr.e_phnum; i++, offset += ehdr.e_phentsize) { PhdrType phdr; - if (!memory->Read(offset, &phdr, sizeof(phdr))) { + if (!memory->ReadFully(offset, &phdr, sizeof(phdr))) { return 0; } if (phdr.p_type == PT_LOAD && phdr.p_offset == 0) { @@ -308,7 +308,7 @@ void ElfInterface::ReadSectionHeaders(const EhdrType& ehdr) { // Skip the first header, it's always going to be NULL. offset += ehdr.e_shentsize; for (size_t i = 1; i < ehdr.e_shnum; i++, offset += ehdr.e_shentsize) { - if (!memory_->Read(offset, &shdr, sizeof(shdr))) { + if (!memory_->ReadFully(offset, &shdr, sizeof(shdr))) { return; } @@ -320,7 +320,7 @@ void ElfInterface::ReadSectionHeaders(const EhdrType& ehdr) { continue; } uint64_t str_offset = ehdr.e_shoff + shdr.sh_link * ehdr.e_shentsize; - if (!memory_->Read(str_offset, &str_shdr, sizeof(str_shdr))) { + if (!memory_->ReadFully(str_offset, &str_shdr, sizeof(str_shdr))) { continue; } if (str_shdr.sh_type != SHT_STRTAB) { |