From 7222539936faa080f418f998e0eca6adda3af1fd Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Mon, 9 Dec 2013 17:11:38 -0800 Subject: [PATCH] node: follow specification, zero-fill ArrayBuffers Fixes #6664 --- src/node.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index f079519fe3..2d32b126e1 100644 --- a/src/node.cc +++ b/src/node.cc @@ -165,7 +165,9 @@ ArrayBufferAllocator ArrayBufferAllocator::the_singleton; void* ArrayBufferAllocator::Allocate(size_t length) { if (length > kMaxLength) return NULL; - return new char[length]; + char* data = new char[length]; + memset(data, 0, length); + return data; }