Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: src/scanner-character-streams.cc

Issue 1356863002: Fix incorrect buffer length. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-character-streams.cc
diff --git a/src/scanner-character-streams.cc b/src/scanner-character-streams.cc
index 7324de6f38fdb60e5262ac550abdb6afc0e555b5..a58f392c0cd6f4ad96df33f4e5aaf92f4cbd0dda 100644
--- a/src/scanner-character-streams.cc
+++ b/src/scanner-character-streams.cc
@@ -458,11 +458,11 @@ void ExternalStreamingStream::ResetToBookmark() {
// bookmark_data_* => current_data_*
// (current_data_ assumes ownership of its memory.)
- uint8_t* data = new uint8_t[bookmark_data_.length() - bookmark_data_offset_];
current_data_offset_ = 0;
current_data_length_ = bookmark_data_.length() - bookmark_data_offset_;
+ uint8_t* data = new uint8_t[current_data_length_];
CopyCharsUnsigned(data, bookmark_data_.begin() + bookmark_data_offset_,
- bookmark_data_.length());
+ current_data_length_);
delete[] current_data_;
current_data_ = data;
bookmark_data_is_from_current_data_ = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698