| Index: net/base/ip_address.cc
|
| diff --git a/net/base/ip_address.cc b/net/base/ip_address.cc
|
| index 42071e010e358be1b30e46431574de9e5dd116f2..7ae68bf44a951587c5776d966945419306595ffa 100644
|
| --- a/net/base/ip_address.cc
|
| +++ b/net/base/ip_address.cc
|
| @@ -158,9 +158,15 @@ bool ParseCIDRBlock(const std::string& cidr_literal,
|
| if (!ip_address->AssignFromIPLiteral(parts[0]))
|
| return false;
|
|
|
| + // TODO(martijnc): Find a more general solution for the overly permissive
|
| + // base::StringToInt() parsing. https://crbug.com/596523.
|
| + const base::StringPiece& prefix_length = parts[1];
|
| + if (prefix_length.starts_with("+"))
|
| + return false;
|
| +
|
| // Parse the prefix length.
|
| int number_of_bits = -1;
|
| - if (!base::StringToInt(parts[1], &number_of_bits))
|
| + if (!base::StringToInt(prefix_length, &number_of_bits))
|
| return false;
|
|
|
| // Make sure the prefix length is in a valid range.
|
|
|