Fix buffer overflow in liveedit.
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 20 May 2010 08:59:36 +0000 (08:59 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 20 May 2010 08:59:36 +0000 (08:59 +0000)
Make sure that there is always room for RelocInfoWriter::kMaxSize
bytes in the buffer before writing to it. We only ensured space for 8
bytes, but relocation information can be up to 16 bytes in x64.

Review URL: http://codereview.chromium.org/2100010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4683 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/liveedit.cc

index 592ef49..b14d3d8 100644 (file)
@@ -988,7 +988,7 @@ class RelocInfoBuffer {
   byte* buffer_;
   int buffer_size_;
 
-  static const int kBufferGap = 8;
+  static const int kBufferGap = RelocInfoWriter::kMaxSize;
   static const int kMaximalBufferSize = 512*MB;
 };