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

Unified Diff: net/proxy/proxy_bypass_rules.cc

Issue 1828103002: Extend net/base/parse_number.h for parsing of negative numbers, and determining if there was overflo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy_num
Patch Set: fix comments Created 4 years, 8 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
« no previous file with comments | « net/cert/x509_cert_types.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_bypass_rules.cc
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index eafaa98cc0593a82608be9d6d49ff99f6d99261b..963f6b0ec604b82961ba2980127600f13ff7b4ec 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -319,8 +319,8 @@ bool ProxyBypassRules::AddRuleFromStringInternal(
std::string::size_type pos_colon = raw.rfind(':');
port = -1;
if (pos_colon != std::string::npos) {
- if (!ParseNonNegativeDecimalInt(
- base::StringPiece(raw.begin() + pos_colon + 1, raw.end()), &port) ||
+ if (!ParseInt32(base::StringPiece(raw.begin() + pos_colon + 1, raw.end()),
+ ParseIntFormat::NON_NEGATIVE, &port) ||
port > 0xFFFF) {
return false; // Port was invalid.
}
« no previous file with comments | « net/cert/x509_cert_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698