Browse Source

delete sig buffer

pull/1641/head
orignal 4 years ago
parent
commit
3792bb4928
  1. 24
      daemon/HTTPServer.cpp

24
daemon/HTTPServer.cpp

@ -1263,12 +1263,15 @@ namespace http {
ident.FromBase32 (b32); ident.FromBase32 (b32);
auto dest = i2p::client::context.FindLocalDestination (ident); auto dest = i2p::client::context.FindLocalDestination (ident);
if (dest) { if (dest)
{
std::size_t pos; std::size_t pos;
pos = name.find (".i2p"); pos = name.find (".i2p");
if (pos == (name.length () - 4)) { if (pos == (name.length () - 4))
{
pos = name.find (".b32.i2p"); pos = name.find (".b32.i2p");
if (pos == std::string::npos) { if (pos == std::string::npos)
{
auto signatureLen = dest->GetIdentity ()->GetSignatureLen (); auto signatureLen = dest->GetIdentity ()->GetSignatureLen ();
uint8_t * signature = new uint8_t[signatureLen]; uint8_t * signature = new uint8_t[signatureLen];
char * sig = new char[signatureLen*2]; char * sig = new char[signatureLen*2];
@ -1280,16 +1283,17 @@ namespace http {
sig[len] = 0; sig[len] = 0;
out << "#!sig=" << sig; out << "#!sig=" << sig;
s << "<b>SUCCESS</b>:<br>\r\n<textarea readonly cols=\"80\" rows=\"10\" wrap=\"on\">" << out.str () << "</textarea>\r\n<br>\r\n<br>\r\n"; s << "<b>SUCCESS</b>:<br>\r\n<textarea readonly cols=\"80\" rows=\"10\" wrap=\"on\">" << out.str () << "</textarea>\r\n<br>\r\n<br>\r\n";
delete[] signature, sig; delete[] signature;
} else { delete[] sig;
}
else
s << "<b>ERROR</b>:&nbsp;Domain can't end with .b32.i2p\r\n<br>\r\n<br>\r\n"; s << "<b>ERROR</b>:&nbsp;Domain can't end with .b32.i2p\r\n<br>\r\n<br>\r\n";
} }
} else { else
s << "<b>ERROR</b>:&nbsp;Domain must end with .i2p\r\n<br>\r\n<br>\r\n"; s << "<b>ERROR</b>:&nbsp;Domain must end with .i2p\r\n<br>\r\n<br>\r\n";
} }
} else { else
s << "<b>ERROR</b>:&nbsp;Such destination is not found\r\n<br>\r\n<br>\r\n"; s << "<b>ERROR</b>:&nbsp;Such destination is not found\r\n<br>\r\n<br>\r\n";
}
s << "<a href=\"" << webroot << "?page=local_destination&b32=" << b32 << "\">Return to destination page</a>\r\n"; s << "<a href=\"" << webroot << "?page=local_destination&b32=" << b32 << "\">Return to destination page</a>\r\n";
return; return;

Loading…
Cancel
Save