Index: runtime/vm/dart.cc |
=================================================================== |
--- runtime/vm/dart.cc (revision 10993) |
+++ runtime/vm/dart.cc (working copy) |
@@ -141,7 +141,13 @@ |
// Initialize from snapshot (this should replicate the functionality |
// of Object::Init(..) in a regular isolate creation path. |
Object::InitFromSnapshot(isolate); |
- const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer); |
+ const Snapshot* snapshot = |
+ Snapshot::SetupFromBuffer(snapshot_buffer, Snapshot::kTrustedLength); |
+ if (snapshot == NULL) { |
+ const String& message = String::Handle(String::New( |
+ "Unexpected error during snapshot parsing.")); |
+ return ApiError::New(message); |
+ } |
if (FLAG_trace_isolates) { |
OS::Print("Size of isolate snapshot = %ld\n", snapshot->length()); |
} |