diff --git a/src/debug.cc b/src/debug.cc index 1179bfc880..da5952ba0d 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -2213,8 +2213,9 @@ Message Message::NewOutput(v8::Handle output, v8::Debug::ClientData* data) { Vector text; if (!output.IsEmpty()) { - text = Vector::New(output->Length() + 1); - output->Write(text.start()); + // Do not include trailing '\0'. + text = Vector::New(output->Length()); + output->Write(text.start(), 0, output->Length()); } return Message(text, data, false); }