Chromium Code Reviews| Index: net/base/ip_address_number.cc |
| diff --git a/net/base/ip_address_number.cc b/net/base/ip_address_number.cc |
| index 1e44b7d3b1ebcc74873fa762eb0ced94411c188d..07dbc56fec09729774dcab2e1593bd9fa2427dba 100644 |
| --- a/net/base/ip_address_number.cc |
| +++ b/net/base/ip_address_number.cc |
| @@ -103,7 +103,7 @@ std::string IPAddressToString(const uint8_t* address, size_t address_len) { |
| } else if (address_len == kIPv6AddressSize) { |
| url::AppendIPv6Address(address, &output); |
| } else { |
| - CHECK(false) << "Invalid IP address with length: " << address_len; |
| + return std::string(); |
| } |
| output.Complete(); |
| @@ -113,6 +113,9 @@ std::string IPAddressToString(const uint8_t* address, size_t address_len) { |
| std::string IPAddressToStringWithPort(const uint8_t* address, |
| size_t address_len, |
| uint16_t port) { |
| + if (address_len != kIPv4AddressSize && address_len != kIPv6AddressSize) |
|
eroman
2016/02/16 19:48:52
How about instead, put the following line after IP
martijnc
2016/02/16 22:02:00
Done.
|
| + return std::string(); |
| + |
| std::string address_str = IPAddressToString(address, address_len); |
| if (address_len == kIPv6AddressSize) { |