1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 08:14:15 +00:00

[addressbook] check domain ending when processing subscriptions

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2021-09-17 02:53:30 +03:00
parent d2faec70be
commit 3dd9e81296
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2

View File

@ -470,6 +470,20 @@ namespace client
if (pos != std::string::npos) if (pos != std::string::npos)
addr = addr.substr(0, pos); // remove comments 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> (); auto ident = std::make_shared<i2p::data::IdentityEx> ();
if (!ident->FromBase64(addr)) { if (!ident->FromBase64(addr)) {
LogPrint (eLogError, "Addressbook: malformed address ", addr, " for ", name); LogPrint (eLogError, "Addressbook: malformed address ", addr, " for ", name);