| Index: extensions/common/permissions/permission_message_util.cc
|
| diff --git a/extensions/common/permissions/permission_message_util.cc b/extensions/common/permissions/permission_message_util.cc
|
| index 0ee3abf27de3787caf18328b88d253794c4a98d9..f184e3dfd9e8404ce95872a88bb7b33a6004780a 100644
|
| --- a/extensions/common/permissions/permission_message_util.cc
|
| +++ b/extensions/common/permissions/permission_message_util.cc
|
| @@ -51,11 +51,16 @@ std::set<std::string> GetDistinctHosts(const URLPatternSet& host_patterns,
|
| host = "*." + host;
|
|
|
| // If the host has an RCD, split it off so we can detect duplicates.
|
| +
|
| + // TODO(bug 657199) this is wrong! This function internally canonicalizes
|
| + // the host and returns the length in the canonicalized string.
|
| + // Canonicalization can change the length of the host components, so these
|
| + // lengths will not necessarily match our string.
|
| std::string rcd;
|
| - size_t reg_len = net::registry_controlled_domains::GetRegistryLength(
|
| - host,
|
| - net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
| - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
| + size_t reg_len =
|
| + net::registry_controlled_domains::BuggyGetHostRegistryLength(
|
| + host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
| + net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
| if (reg_len && reg_len != std::string::npos) {
|
| if (include_rcd) // else leave rcd empty
|
| rcd = host.substr(host.size() - reg_len);
|
|
|