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

Unified Diff: chrome/browser/safe_browsing/protocol_parser.cc

Issue 16595: Ignore GetHash results for lists that we don't support. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | chrome/browser/safe_browsing/protocol_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/protocol_parser.cc
===================================================================
--- chrome/browser/safe_browsing/protocol_parser.cc (revision 7554)
+++ chrome/browser/safe_browsing/protocol_parser.cc (working copy)
@@ -90,6 +90,13 @@
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));
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/protocol_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698