Index: net/base/net_util.cc |
diff --git a/net/base/net_util.cc b/net/base/net_util.cc |
index b9cf59f1789a910bed6242794417f5592f0694f1..d8ef1bedd96b9654c5f6fba668df8c0d48946c86 100644 |
--- a/net/base/net_util.cc |
+++ b/net/base/net_util.cc |
@@ -301,7 +301,7 @@ bool IsPortAllowedByDefault(int port) { |
return false; |
} |
} |
- return true; |
+ return port >= 0 && port <= 65535; |
Peter Kasting
2014/11/12 23:54:31
This ensures it's safe to cast the port number to
mmenke
2014/11/13 16:00:42
Not a big fan of depending on this for correctness
|
} |
bool IsPortAllowedByFtp(int port) { |
@@ -568,7 +568,7 @@ bool GetIPAddressFromSockAddr(const struct sockaddr* sock_addr, |
*address = reinterpret_cast<const uint8*>(&addr->btAddr); |
*address_len = kBluetoothAddressSize; |
if (port) |
- *port = addr->port; |
+ *port = static_cast<uint16>(addr->port); |
return true; |
} |
#endif |