diff options
author | Christopher Ferris <cferris@google.com> | 2017-11-08 21:55:17 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-11-08 21:55:17 +0000 |
commit | 1a57a08bb5fb18355e519ffb0445f2129dca05e0 (patch) | |
tree | a2b3d243389c355ce4b3d14ea3958f029c29e882 /libunwindstack/DwarfEhFrameWithHdr.cpp | |
parent | 9b45da952c5c689b0f73e73ed6b49784698ead81 (diff) | |
parent | 5ead5f7df9c9cba28c37617929e4a278271bc096 (diff) |
Merge "Fix another nullptr dereference." am: 331d8e9b1a
am: 5ead5f7df9
Change-Id: I8911bbc38a09b7222d67736a9271bfc31c1beba4
Diffstat (limited to 'libunwindstack/DwarfEhFrameWithHdr.cpp')
-rw-r--r-- | libunwindstack/DwarfEhFrameWithHdr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libunwindstack/DwarfEhFrameWithHdr.cpp b/libunwindstack/DwarfEhFrameWithHdr.cpp index d8cbdf439..0337dbaac 100644 --- a/libunwindstack/DwarfEhFrameWithHdr.cpp +++ b/libunwindstack/DwarfEhFrameWithHdr.cpp @@ -115,6 +115,9 @@ bool DwarfEhFrameWithHdr<AddressType>::GetFdeOffsetBinary(uint64_t pc, uint64_t* while (first < last) { size_t current = (first + last) / 2; const FdeInfo* info = GetFdeInfoFromIndex(current); + if (info == nullptr) { + return false; + } if (pc == info->pc) { *fde_offset = info->offset; return true; @@ -127,6 +130,9 @@ bool DwarfEhFrameWithHdr<AddressType>::GetFdeOffsetBinary(uint64_t pc, uint64_t* } if (last != 0) { const FdeInfo* info = GetFdeInfoFromIndex(last - 1); + if (info == nullptr) { + return false; + } *fde_offset = info->offset; return true; } |