mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-27 15:32:10 +08:00
Validate number of bytes read
Bug: chromium:1380083 Change-Id: I54a0dfb72b586638124ecc4150f0b90b9e1aa1d5 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3994208 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
31af46b91e
commit
30ca5564f8
@ -331,6 +331,11 @@ ssize_t PtraceClient::ReadUpTo(VMAddress address, size_t size, void* buffer) {
|
|||||||
return total_read;
|
return total_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (static_cast<size_t>(bytes_read) > size) {
|
||||||
|
LOG(ERROR) << "invalid size " << bytes_read;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!LoggingReadFileExactly(sock_, buffer_c, bytes_read)) {
|
if (!LoggingReadFileExactly(sock_, buffer_c, bytes_read)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user