Fix off-by-one error introduced in r12598. (issue 10977009)

12 views
Skip to first unread message

yan...@chromium.org

unread,
Sep 25, 2012, 2:04:22 AM9/25/12
to verw...@chromium.org, v8-...@googlegroups.com
Reviewers: Toon Verwaest,

Description:
Fix off-by-one error introduced in r12598.


R=verw...@chromium.org
BUG=


Please review this at https://chromiumcodereview.appspot.com/10977009/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
M src/json-parser.h


Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index
ad01726415d3b47543160c521f695c2498560b0e..21c3623ef88fc5d0058c4ffdf32fcfeaa580c9cc
100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -580,7 +580,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
if (c0_ < 0x20) return Handle<String>::null();
running_hash = StringHasher::AddCharacterCore(running_hash, c0);
position++;
- if (position > source_length_) return Handle<String>::null();
+ if (position >= source_length_) return Handle<String>::null();
c0 = seq_source_->SeqAsciiStringGet(position);
} while (c0 != '"');
int length = position - position_;


verw...@chromium.org

unread,
Sep 25, 2012, 12:58:12 PM9/25/12
to yan...@chromium.org, v8-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages