mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-12-23 13:05:27 +00:00
Correct incorrect bounds checking.
Review URL: http://breakpad.appspot.com/319002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@874 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
446616ee22
commit
70698339f6
|
@ -107,11 +107,11 @@ bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) {
|
|||
if (memory_) {
|
||||
bool result = true;
|
||||
if (offset + size > memory_size_) {
|
||||
if (offset >= memory_size_)
|
||||
return false;
|
||||
size = memory_size_ - offset;
|
||||
result = false;
|
||||
}
|
||||
if (size < 0)
|
||||
return false;
|
||||
memcpy(buffer, static_cast<char *>(memory_) + offset, size);
|
||||
return result;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue