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

fixed out of range bug

This commit is contained in:
orignal 2014-01-06 20:56:44 -05:00
parent 040d0f5f58
commit cbe58c8bb1
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ namespace stream
auto outbound = i2p::tunnel::tunnels.GetNextOutboundTunnel (); auto outbound = i2p::tunnel::tunnels.GetNextOutboundTunnel ();
if (outbound) if (outbound)
{ {
auto lease = m_RemoteLeaseSet->GetLeases ()[0]; // TODO: auto& lease = m_RemoteLeaseSet->GetLeases ()[0]; // TODO:
outbound->SendTunnelDataMsg (lease.tunnelGateway, lease.tunnelID, msg); outbound->SendTunnelDataMsg (lease.tunnelGateway, lease.tunnelID, msg);
} }
else else
@ -235,7 +235,7 @@ namespace stream
compressor.MessageEnd(); compressor.MessageEnd();
int size = compressor.MaxRetrievable (); int size = compressor.MaxRetrievable ();
uint8_t * buf = msg->GetPayload (); uint8_t * buf = msg->GetPayload ();
*(uint16_t *)buf = htobe32 (size); // length *(uint32_t *)buf = htobe32 (size); // length
buf += 4; buf += 4;
compressor.Get (buf, size); compressor.Get (buf, size);
buf[9] = 6; // streaming protocol buf[9] = 6; // streaming protocol

View File

@ -16,7 +16,7 @@ namespace tunnel
CreateCurrentTunnelDataMessage (); CreateCurrentTunnelDataMessage ();
// create delivery instructions // create delivery instructions
uint8_t di[40]; uint8_t di[43]; // max delivery instruction length is 43 for tunnel
size_t diLen = 1;// flag size_t diLen = 1;// flag
TunnelDeliveryType dt = eDeliveryTypeLocal; TunnelDeliveryType dt = eDeliveryTypeLocal;
if (gwHash) if (gwHash)