Browse Source

[addressbook] check domain ending when processing subscriptions

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/1696/head
R4SAS 3 years ago
parent
commit
3dd9e81296
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 14
      libi2pd_client/AddressBook.cpp

14
libi2pd_client/AddressBook.cpp

@ -470,6 +470,20 @@ namespace client @@ -470,6 +470,20 @@ namespace client
if (pos != std::string::npos)
addr = addr.substr(0, pos); // remove comments
pos = name.find(".b32.i2p");
if (pos != std::string::npos)
{
LogPrint (eLogError, "Addressbook: skipped adding of b32 address: ", name);
continue;
}
pos = name.find(".i2p");
if (pos == std::string::npos)
{
LogPrint (eLogError, "Addressbook: malformed domain: ", name);
continue;
}
auto ident = std::make_shared<i2p::data::IdentityEx> ();
if (!ident->FromBase64(addr)) {
LogPrint (eLogError, "Addressbook: malformed address ", addr, " for ", name);

Loading…
Cancel
Save