Skip to content

Commit

Permalink
fixed out of range bug
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jan 7, 2014
1 parent 040d0f5 commit cbe58c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Streaming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace stream
auto outbound = i2p::tunnel::tunnels.GetNextOutboundTunnel ();
if (outbound)
{
auto lease = m_RemoteLeaseSet->GetLeases ()[0]; // TODO:
auto& lease = m_RemoteLeaseSet->GetLeases ()[0]; // TODO:
outbound->SendTunnelDataMsg (lease.tunnelGateway, lease.tunnelID, msg);
}
else
Expand Down Expand Up @@ -235,7 +235,7 @@ namespace stream
compressor.MessageEnd();
int size = compressor.MaxRetrievable ();
uint8_t * buf = msg->GetPayload ();
*(uint16_t *)buf = htobe32 (size); // length
*(uint32_t *)buf = htobe32 (size); // length
buf += 4;
compressor.Get (buf, size);
buf[9] = 6; // streaming protocol
Expand Down
2 changes: 1 addition & 1 deletion TunnelGateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace tunnel
CreateCurrentTunnelDataMessage ();

// create delivery instructions
uint8_t di[40];
uint8_t di[43]; // max delivery instruction length is 43 for tunnel
size_t diLen = 1;// flag
TunnelDeliveryType dt = eDeliveryTypeLocal;
if (gwHash)
Expand Down

0 comments on commit cbe58c8

Please sign in to comment.