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

Unified Diff: chrome/browser/ssl/ssl_error_info.cc

Issue 1025523004: Removed implicit cast from size_t to int, prevent an unlikely but theoretically possible integer ov… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made it a void function since the return value is never used. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_error_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_error_info.cc
diff --git a/chrome/browser/ssl/ssl_error_info.cc b/chrome/browser/ssl/ssl_error_info.cc
index 80aaf9b6c1c1ebe23b45b4c9f3c09a61dbc50513..31874150eae112d9efd6424458b3a4fbaf6fed62 100644
--- a/chrome/browser/ssl/ssl_error_info.cc
+++ b/chrome/browser/ssl/ssl_error_info.cc
@@ -211,10 +211,10 @@ SSLErrorInfo::ErrorType SSLErrorInfo::NetErrorToErrorType(int net_error) {
}
// static
-int SSLErrorInfo::GetErrorsForCertStatus(int cert_id,
- net::CertStatus cert_status,
- const GURL& url,
- std::vector<SSLErrorInfo>* errors) {
+void SSLErrorInfo::GetErrorsForCertStatus(int cert_id,
+ net::CertStatus cert_status,
+ const GURL& url,
+ std::vector<SSLErrorInfo>* errors) {
const net::CertStatus kErrorFlags[] = {
net::CERT_STATUS_COMMON_NAME_INVALID,
net::CERT_STATUS_DATE_INVALID,
@@ -245,10 +245,8 @@ int SSLErrorInfo::GetErrorsForCertStatus(int cert_id,
DCHECK(arraysize(kErrorFlags) == arraysize(kErrorTypes));
scoped_refptr<net::X509Certificate> cert = NULL;
- int count = 0;
for (size_t i = 0; i < arraysize(kErrorFlags); ++i) {
if (cert_status & kErrorFlags[i]) {
- count++;
if (!cert.get()) {
bool r = content::CertStore::GetInstance()->RetrieveCert(
cert_id, &cert);
@@ -260,5 +258,4 @@ int SSLErrorInfo::GetErrorsForCertStatus(int cert_id,
}
}
}
- return count;
}
« no previous file with comments | « chrome/browser/ssl/ssl_error_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698