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

Unified Diff: runtime/vm/native_message_handler.cc

Issue 10829444: Avoid trusting the length encoded in the Snapshot if there is an (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « runtime/vm/message_test.cc ('k') | runtime/vm/port_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_message_handler.cc
===================================================================
--- runtime/vm/native_message_handler.cc (revision 11409)
+++ runtime/vm/native_message_handler.cc (working copy)
@@ -49,12 +49,7 @@
// Enter a native scope for handling the message. This will create a
// zone for allocating the objects for decoding the message.
ApiNativeScope scope;
-
- int32_t length = reinterpret_cast<int32_t*>(
- message->data())[Snapshot::kLengthIndex];
- ApiMessageReader reader(message->data() + Snapshot::kHeaderSize,
- length,
- zone_allocator);
+ ApiMessageReader reader(message->data(), message->len(), zone_allocator);
Dart_CObject* object = reader.ReadMessage();
(*func())(message->dest_port(), message->reply_port(), object);
delete message;
« no previous file with comments | « runtime/vm/message_test.cc ('k') | runtime/vm/port_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698