mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
fix uninitialized variable block.tunnelID
This commit is contained in:
parent
60d3e4d963
commit
ff0b6a6a6a
1 changed files with 9 additions and 3 deletions
|
@ -300,21 +300,27 @@ namespace tunnel
|
||||||
void OutboundTunnel::SendTunnelDataMsgTo (const uint8_t * gwHash, uint32_t gwTunnel, std::shared_ptr<i2p::I2NPMessage> msg)
|
void OutboundTunnel::SendTunnelDataMsgTo (const uint8_t * gwHash, uint32_t gwTunnel, std::shared_ptr<i2p::I2NPMessage> msg)
|
||||||
{
|
{
|
||||||
TunnelMessageBlock block;
|
TunnelMessageBlock block;
|
||||||
|
block.tunnelID = 0; // Initialize tunnelID to a default value
|
||||||
|
|
||||||
if (gwHash)
|
if (gwHash)
|
||||||
{
|
{
|
||||||
block.hash = gwHash;
|
block.hash = gwHash;
|
||||||
if (gwTunnel)
|
if (gwTunnel)
|
||||||
{
|
{
|
||||||
block.deliveryType = eDeliveryTypeTunnel;
|
block.deliveryType = eDeliveryTypeTunnel;
|
||||||
block.tunnelID = gwTunnel;
|
block.tunnelID = gwTunnel; // Set tunnelID only if gwTunnel is non-zero
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
block.deliveryType = eDeliveryTypeRouter;
|
block.deliveryType = eDeliveryTypeRouter;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
block.deliveryType = eDeliveryTypeLocal;
|
block.deliveryType = eDeliveryTypeLocal;
|
||||||
block.data = msg;
|
}
|
||||||
|
|
||||||
|
block.data = msg;
|
||||||
SendTunnelDataMsgs({block});
|
SendTunnelDataMsgs({block});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue