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

Side by Side Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 1028243002: Validate that zip entry filenames are UTF8. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/safe_browsing/download_protection_service.h" 5 #include "chrome/browser/safe_browsing/download_protection_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 583
584 void OnZipAnalysisFinished(const zip_analyzer::Results& results) { 584 void OnZipAnalysisFinished(const zip_analyzer::Results& results) {
585 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 585 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
586 if (!service_) 586 if (!service_)
587 return; 587 return;
588 if (results.success) { 588 if (results.success) {
589 zipped_executable_ = results.has_executable; 589 zipped_executable_ = results.has_executable;
590 archived_binary_.CopyFrom(results.archived_binary); 590 archived_binary_.CopyFrom(results.archived_binary);
591 DVLOG(1) << "Zip analysis finished for " << item_->GetFullPath().value() 591 DVLOG(1) << "Zip analysis finished for " << item_->GetFullPath().value()
592 << ", has_executable=" << results.has_executable 592 << ", has_executable=" << results.has_executable
593 << " has_archive=" << results.has_archive; 593 << " has_archive=" << results.has_archive
594 << " has_unsafe_file=" << results.has_unsafe_file;
595 UMA_HISTOGRAM_BOOLEAN("SBClientDownload.ZipFileHasUnsafeFile",
596 results.has_unsafe_file);
594 } else { 597 } else {
595 DVLOG(1) << "Zip analysis failed for " << item_->GetFullPath().value(); 598 DVLOG(1) << "Zip analysis failed for " << item_->GetFullPath().value();
596 } 599 }
597 UMA_HISTOGRAM_BOOLEAN("SBClientDownload.ZipFileHasExecutable", 600 UMA_HISTOGRAM_BOOLEAN("SBClientDownload.ZipFileHasExecutable",
598 zipped_executable_); 601 zipped_executable_);
599 UMA_HISTOGRAM_BOOLEAN("SBClientDownload.ZipFileHasArchiveButNoExecutable", 602 UMA_HISTOGRAM_BOOLEAN("SBClientDownload.ZipFileHasArchiveButNoExecutable",
600 results.has_archive && !zipped_executable_); 603 results.has_archive && !zipped_executable_);
601 UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractZipFeaturesTime", 604 UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractZipFeaturesTime",
602 base::TimeTicks::Now() - zip_analysis_start_time_); 605 base::TimeTicks::Now() - zip_analysis_start_time_);
603 606
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 GURL DownloadProtectionService::GetDownloadRequestUrl() { 1143 GURL DownloadProtectionService::GetDownloadRequestUrl() {
1141 GURL url(kDownloadRequestUrl); 1144 GURL url(kDownloadRequestUrl);
1142 std::string api_key = google_apis::GetAPIKey(); 1145 std::string api_key = google_apis::GetAPIKey();
1143 if (!api_key.empty()) 1146 if (!api_key.empty())
1144 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); 1147 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true));
1145 1148
1146 return url; 1149 return url;
1147 } 1150 }
1148 1151
1149 } // namespace safe_browsing 1152 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | chrome/common/safe_browsing/zip_analyzer.cc » ('j') | chrome/common/safe_browsing/zip_analyzer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698