1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-31 00:34:20 +00:00

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 // send destination first like received from I2P
std::string dest = m_Stream->GetRemoteIdentity ()->ToBase64 (); std::string dest = m_Stream->GetRemoteIdentity ()->ToBase64 ();
dest += "\n"; 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 ()); HandleStreamReceive (boost::system::error_code (), dest.size ());
} }
Receive (); Receive ();