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
1 changed files with 2 additions and 2 deletions
|
@ -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