Index: net/http/http_server_properties_manager.cc |
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc |
index 794030d8a531ee7148257c97c99db85baf8e6850..58876f39348e0d8b91d4ba2e40550096d5b7bc09 100644 |
--- a/net/http/http_server_properties_manager.cc |
+++ b/net/http/http_server_properties_manager.cc |
@@ -419,7 +419,7 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() { |
int port = 0; |
if (!port_alternate_protocol_dict->GetIntegerWithoutPathExpansion( |
"port", &port) || |
- (port > (1 << 16))) { |
+ (port > std::numeric_limits<uint16>::max())) { |
Peter Kasting
2014/11/12 23:54:31
The old code would have erroneously allowed 65536.
|
DVLOG(1) << "Malformed Alternate-Protocol server: " << server_str; |
detected_corrupted_prefs = true; |
continue; |
@@ -448,9 +448,8 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() { |
continue; |
} |
- net::AlternateProtocolInfo port_alternate_protocol(port, |
- protocol, |
- probability); |
+ net::AlternateProtocolInfo port_alternate_protocol( |
+ static_cast<uint16>(port), protocol, probability); |
alternate_protocol_map->Put(server, port_alternate_protocol); |
++count; |
} while (false); |