From 2182a0add52ffc93713ae78d38a200fa320c87a5 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 9 Aug 2026 15:02:21 -0400 Subject: [PATCH] fixed possible overflow with negative value --- libi2pd/Streaming.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index b7084596..4fb55163 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -1178,7 +1178,7 @@ namespace stream int64_t passedTime = m_PacketACKInterval * INITIAL_WINDOW_SIZE; // in microseconds // while m_LastACKSendTime == 0 if (m_LastACKSendTime) passedTime = (ts - m_LastACKSendTime)*1000; // in microseconds - numPackets = (passedTime + m_PacketACKIntervalRem) / m_PacketACKInterval; + numPackets = (passedTime + (int64_t)m_PacketACKIntervalRem) / (int64_t)m_PacketACKInterval; int64_t delta = numPackets * (int64_t)m_PacketACKInterval - passedTime; if (delta < (int64_t)m_PacketACKIntervalRem) m_PacketACKIntervalRem -= delta;