summaryrefslogtreecommitdiff
path: root/chromium/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/crashpad/crashpad/util/linux/ptrace_client.cc')
-rw-r--r--chromium/third_party/crashpad/crashpad/util/linux/ptrace_client.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chromium/third_party/crashpad/crashpad/util/linux/ptrace_client.cc b/chromium/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
index 1863841f73f..32cc35d9567 100644
--- a/chromium/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
+++ b/chromium/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
@@ -331,6 +331,11 @@ ssize_t PtraceClient::ReadUpTo(VMAddress address, size_t size, void* buffer) {
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)) {
return -1;
}