Skip to content

Commit

Permalink
Fix an overflow crash in DiscImageDevice::Verify
Browse files Browse the repository at this point in the history
  • Loading branch information
DrChat committed Jan 14, 2016
1 parent 9473f20 commit e8719dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/xenia/vfs/devices/disc_image_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ DiscImageDevice::Error DiscImageDevice::Verify(ParseState* state) {
}

bool DiscImageDevice::VerifyMagic(ParseState* state, size_t offset) {
if (offset >= state->size) {
return false;
}

// Simple check to see if the given offset contains the magic value.
return std::memcmp(state->ptr + offset, "MICROSOFT*XBOX*MEDIA", 20) == 0;
}
Expand Down

0 comments on commit e8719dd

Please sign in to comment.