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

Unified Diff: runtime/vm/message_handler.cc

Issue 933183003: Fix use-after-free in MessageHandler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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: runtime/vm/message_handler.cc
===================================================================
--- runtime/vm/message_handler.cc (revision 43828)
+++ runtime/vm/message_handler.cc (working copy)
@@ -157,13 +157,15 @@
// The monitor was acquired in MessageHandler::TaskCallback().
monitor_.Exit();
Message::Priority saved_priority = message->priority();
+ Dart_Port saved_dest_port = message->dest_port();
result = HandleMessage(message);
+ message = NULL; // May be deleted by now.
monitor_.Enter();
if (FLAG_trace_isolates) {
OS::Print("[.] Message handled:\n"
"\thandler: %s\n"
"\tport: %" Pd64 "\n",
- name(), message->dest_port());
+ name(), saved_dest_port);
}
if (!result) {
// If we hit an error, we're done processing messages.
« 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