prevent overflow

This commit is contained in:
Jeff Becker 2016-12-25 08:18:23 -05:00
parent 4688e6d534
commit 858b497199

View File

@ -212,7 +212,9 @@ namespace client
// send destination first like received from I2P
std::string dest = m_Stream->GetRemoteIdentity ()->ToBase64 ();
dest += "\n";
memcpy (m_StreamBuffer, dest.c_str (), dest.size ());
if(sizeof(m_StreamBuffer) >= dest.size()) {
memcpy (m_StreamBuffer, dest.c_str (), dest.size ());
}
HandleStreamReceive (boost::system::error_code (), dest.size ());
}
Receive ();