Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 10243003: Fix invalid pointer arithmetic in Linux and MacOS event handler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_linux.cc
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 3b39ddc74dc8d59366b1e731c86a31adaa1a703d..e15f3dfd6b39da908c9552a7d124fdb07547d7e3 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -168,16 +168,17 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
bool EventHandlerImplementation::GetInterruptMessage(InterruptMessage* msg) {
+ char* dst = reinterpret_cast<char*>(msg);
int total_read = 0;
int bytes_read =
- TEMP_FAILURE_RETRY(read(interrupt_fds_[0], msg, kInterruptMessageSize));
+ TEMP_FAILURE_RETRY(read(interrupt_fds_[0], dst, kInterruptMessageSize));
if (bytes_read < 0) {
return false;
}
total_read = bytes_read;
while (total_read < kInterruptMessageSize) {
bytes_read = TEMP_FAILURE_RETRY(read(interrupt_fds_[0],
- msg + total_read,
+ dst + total_read,
kInterruptMessageSize - total_read));
if (bytes_read > 0) {
total_read = total_read + bytes_read;
« no previous file with comments | « no previous file | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698