Skip to content

Commit

Permalink
Merge pull request #28 from rc0r/patch_26
Browse files Browse the repository at this point in the history
Added nullptr check in PE::get_raw_bytes().
  • Loading branch information
JusticeRage committed Oct 18, 2017
2 parents 4aee3d5 + 3c00302 commit 17ee376
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manape/pe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ PE::PE_ARCHITECTURE PE::get_architecture() const {

shared_bytes PE::get_raw_bytes(size_t size) const
{
if(_file_handle == nullptr) {
return nullptr;
}
fseek(_file_handle.get(), 0, SEEK_SET);
if (size > _file_size) {
size = static_cast<size_t>(_file_size);
Expand Down

0 comments on commit 17ee376

Please sign in to comment.