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

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: 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
« chrome/browser/ssl/ssl_error_info.h ('K') | « 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..7ccc369de53ec3d3dfb56dbf77581db6f7bd1701 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) {
+size_t 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,7 +245,7 @@ int SSLErrorInfo::GetErrorsForCertStatus(int cert_id,
DCHECK(arraysize(kErrorFlags) == arraysize(kErrorTypes));
scoped_refptr<net::X509Certificate> cert = NULL;
- int count = 0;
+ size_t count = 0;
for (size_t i = 0; i < arraysize(kErrorFlags); ++i) {
if (cert_status & kErrorFlags[i]) {
count++;
« chrome/browser/ssl/ssl_error_info.h ('K') | « 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