From cbe58c8bb1321141a4291af08d11a87f0559230f Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 6 Jan 2014 20:56:44 -0500 Subject: [PATCH] fixed out of range bug --- Streaming.cpp | 4 ++-- TunnelGateway.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Streaming.cpp b/Streaming.cpp index e0d64a77..05d9933c 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -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 @@ -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 diff --git a/TunnelGateway.cpp b/TunnelGateway.cpp index 6e0db1f0..24f1a0ec 100644 --- a/TunnelGateway.cpp +++ b/TunnelGateway.cpp @@ -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)