Index: chrome/browser/safe_browsing/download_protection_service.cc |
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc |
index 418385009c58ed7bdb56f91a7ff857b33f315226..d12fd5e75c51ea42c9576e151071062855145538 100644 |
--- a/chrome/browser/safe_browsing/download_protection_service.cc |
+++ b/chrome/browser/safe_browsing/download_protection_service.cc |
@@ -194,9 +194,15 @@ class DownloadSBClient |
for (size_t i = 0; i < url_chain_.size(); ++i) { |
post_data += url_chain_[i].spec() + "\n"; |
} |
+ // Be careful about taking the front()/back() of possibly-empty vectors! |
+ // http://crbug.com/190096 |
+ const GURL& malicious_url = url_chain_.empty() ? GURL::EmptyGURL() |
+ : url_chain_.back(); |
+ const GURL& page_url = url_chain_.empty() ? GURL::EmptyGURL() |
+ : url_chain_.front(); |
ui_manager_->ReportSafeBrowsingHit( |
- url_chain_.back(), // malicious_url |
- url_chain_.front(), // page_url |
+ malicious_url, |
+ page_url, |
referrer_url_, |
true, // is_subresource |
threat_type, |