Skip to content

Commit

Permalink
Fix #784
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Sep 12, 2022
1 parent 98d3392 commit 24935f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MachO/Binary.cpp
Expand Up @@ -540,7 +540,7 @@ const SegmentCommand* Binary::segment_from_offset(uint64_t offset) const {
}

auto it = offset_seg_.lower_bound(offset);
if (it->first == offset || it == it_begin) {
if (it != std::end(offset_seg_) && (it->first == offset || it == it_begin)) {
SegmentCommand* seg = it->second;
if (seg->file_offset() <= offset && offset < (seg->file_offset() + seg->file_size())) {
return seg;
Expand Down

0 comments on commit 24935f6

Please sign in to comment.