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

Unified Diff: net/base/host_port_pair.cc

Issue 732423002: Update from chromium https://crrev.com/304586 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « net/BUILD.gn ('k') | net/base/host_port_pair_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_port_pair.cc
diff --git a/net/base/host_port_pair.cc b/net/base/host_port_pair.cc
index 6675692123a58a26091fdd8b1a290c139185fc7c..18cf9f5e7b2de6d14df0a957d0583b9dafac1947 100644
--- a/net/base/host_port_pair.cc
+++ b/net/base/host_port_pair.cc
@@ -10,6 +10,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/base/ip_endpoint.h"
+#include "net/base/net_util.h"
#include "url/gurl.h"
namespace net {
@@ -36,7 +37,8 @@ HostPortPair HostPortPair::FromString(const std::string& str) {
int port;
if (!base::StringToInt(key_port[1], &port))
return HostPortPair();
- DCHECK_LT(port, 1 << 16);
+ if (!IsPortValid(port))
+ return HostPortPair();
HostPortPair host_port_pair;
host_port_pair.set_host(key_port[0]);
host_port_pair.set_port(port);
« no previous file with comments | « net/BUILD.gn ('k') | net/base/host_port_pair_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698