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

Unified Diff: dart/runtime/bin/eventhandler_win.cc

Issue 925443002: Fix potential use-after-free bug in windows eventhandler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/bin/eventhandler_win.cc
diff --git a/dart/runtime/bin/eventhandler_win.cc b/dart/runtime/bin/eventhandler_win.cc
index 73c738d9b397bd2c443bba1aad0f867c07308f84..d3091f6d6198a81f31cc9f803b5303f205fc0885 100644
--- a/dart/runtime/bin/eventhandler_win.cc
+++ b/dart/runtime/bin/eventhandler_win.cc
@@ -1029,7 +1029,6 @@ void EventHandlerImplementation::HandleInterrupt(InterruptMessage* msg) {
if (registry->CloseSafe(reinterpret_cast<intptr_t>(listen_socket))) {
ASSERT(listen_socket->Mask() == 0);
listen_socket->Close();
- DeleteIfClosed(handle);
}
DartUtils::PostInt32(msg->dart_port, 1 << kDestroyedEvent);
@@ -1038,7 +1037,6 @@ void EventHandlerImplementation::HandleInterrupt(InterruptMessage* msg) {
}
} else {
handle->EnsureInitialized(this);
-
Handle::ScopedLock lock(handle);
if (IS_COMMAND(msg->data, kReturnTokenCommand)) {
@@ -1101,8 +1099,9 @@ void EventHandlerImplementation::HandleInterrupt(InterruptMessage* msg) {
} else {
UNREACHABLE();
}
- DeleteIfClosed(handle);
}
+
+ DeleteIfClosed(handle);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698