summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/protocol_parser.cc
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 01:22:30 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 01:22:30 +0000
commit3b0f5f6fb61bd3a896670d91e8aa42c4e2c772b9 (patch)
treea15d63db3fda923116a959397c0da2023c37f2ee /chrome/browser/safe_browsing/protocol_parser.cc
parent9162a11c97dd8f1a8a701f5ce04905b0cf41991e (diff)
downloadchromium_src-3b0f5f6fb61bd3a896670d91e8aa42c4e2c772b9.zip
chromium_src-3b0f5f6fb61bd3a896670d91e8aa42c4e2c772b9.tar.gz
chromium_src-3b0f5f6fb61bd3a896670d91e8aa42c4e2c772b9.tar.bz2
Ignore GetHash results for lists that we don't support.
BUG=5597 (http://crbug.com/5597) Review URL: http://codereview.chromium.org/16595 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/protocol_parser.cc')
-rw-r--r--chrome/browser/safe_browsing/protocol_parser.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/safe_browsing/protocol_parser.cc b/chrome/browser/safe_browsing/protocol_parser.cc
index dcfd247..0359a1c 100644
--- a/chrome/browser/safe_browsing/protocol_parser.cc
+++ b/chrome/browser/safe_browsing/protocol_parser.cc
@@ -90,6 +90,13 @@ bool SafeBrowsingProtocolParser::ParseGetHash(
full_hash.add_chunk_id = atoi(cmd_parts[1].c_str());
int full_hash_len = atoi(cmd_parts[2].c_str());
+ // Ignore hash results from lists we don't recognize.
+ if (safe_browsing_util::GetListId(full_hash.list_name) < 0) {
+ data += full_hash_len;
+ length -= full_hash_len;
+ continue;
+ }
+
while (full_hash_len > 0) {
DCHECK(static_cast<size_t>(full_hash_len) >= sizeof(SBFullHash));
memcpy(&full_hash.hash, data, sizeof(SBFullHash));