From 82ac3f303132a7f46241f349dd69df7a8a865f43 Mon Sep 17 00:00:00 2001 From: "iposva@chromium.org" Date: Fri, 17 Apr 2009 00:57:21 +0000 Subject: [PATCH] - Fix buffer overflow in the pre-allocated memory thread. Review URL: http://codereview.chromium.org/67248 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1733 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/top.cc | 4 ++-- test/mjsunit/regexp-multiline-stack-trace.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/top.cc b/src/top.cc index 82221c1..3c4b8dd 100644 --- a/src/top.cc +++ b/src/top.cc @@ -123,8 +123,8 @@ class PreallocatedMemoryThread: public Thread { local_buffer.length()); // Publish the local buffer and signal its availability. - data_ = &local_buffer[0]; - length_ = sizeof(local_buffer); + data_ = local_buffer.start(); + length_ = local_buffer.length(); data_ready_semaphore_->Signal(); while (keep_running_) { diff --git a/test/mjsunit/regexp-multiline-stack-trace.js b/test/mjsunit/regexp-multiline-stack-trace.js index aa2de88..fc248ef 100644 --- a/test/mjsunit/regexp-multiline-stack-trace.js +++ b/test/mjsunit/regexp-multiline-stack-trace.js @@ -25,6 +25,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// The flags below are to test the trace-calls functionality and the +// preallocated meessage memory. // Flags: --trace-calls --preallocate-message-memory /** -- 2.7.4