The expected key is a valid identifier, which is already free of \\, <0x20, ".

BUG=

Review URL: https://codereview.chromium.org/936613006

Cr-Commit-Position: refs/heads/master@{#26725}
This commit is contained in:
verwaest 2015-02-18 07:48:30 -08:00 committed by Commit bot
parent 94e683b526
commit 69ecbc75b8

View File

@ -108,10 +108,8 @@ class JsonParser BASE_EMBEDDED {
const uint8_t* expected_chars = content.ToOneByteVector().start(); const uint8_t* expected_chars = content.ToOneByteVector().start();
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
uint8_t c0 = input_chars[i]; uint8_t c0 = input_chars[i];
if (c0 != expected_chars[i] || // The expected string has to be free of \, " and characters < 0x20.
c0 == '"' || c0 < 0x20 || c0 == '\\') { if (c0 != expected_chars[i]) return false;
return false;
}
} }
if (input_chars[length] == '"') { if (input_chars[length] == '"') {
position_ = position_ + length + 1; position_ = position_ + length + 1;