summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/socket/ssl_client_socket_pool.cc3
-rw-r--r--net/socket/ssl_host_info.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index 5f8daa7..75d36cb 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -338,7 +338,8 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
const std::string& host = params_->host_and_port().host();
bool is_google = host == "google.com" ||
- host.rfind(".google.com") == host.size() - 11;
+ (host.size() > 11 &&
+ host.rfind(".google.com") == host.size() - 11);
if (is_google) {
UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google",
connect_duration,
diff --git a/net/socket/ssl_host_info.cc b/net/socket/ssl_host_info.cc
index 75a6f378..347dada 100644
--- a/net/socket/ssl_host_info.cc
+++ b/net/socket/ssl_host_info.cc
@@ -188,7 +188,8 @@ void SSLHostInfo::VerifyCallback(int rv) {
base::TimeTicks now = base::TimeTicks::Now();
const base::TimeDelta duration = now - verification_start_time();
bool is_google = hostname_ == "google.com" ||
- hostname_.rfind(".google.com") == hostname_.size() - 11;
+ (hostname_.size() > 11 &&
+ hostname_.rfind(".google.com") == hostname_.size() - 11);
if (is_google) {
UMA_HISTOGRAM_TIMES("Net.SSLHostInfoVerificationTimeMs_Google", duration);
}