From 8ecce1eb5ca72b0c4e0264df59624412da3ce1d0 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 4 Jan 2026 20:56:01 -0600 Subject: [PATCH] Fix for integer overflow --- src/modules/Native/StoreForwardPlusPlus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/Native/StoreForwardPlusPlus.cpp b/src/modules/Native/StoreForwardPlusPlus.cpp index 38466208b..4f624785a 100644 --- a/src/modules/Native/StoreForwardPlusPlus.cpp +++ b/src/modules/Native/StoreForwardPlusPlus.cpp @@ -450,7 +450,7 @@ bool StoreForwardPlusPlusModule::handleReceivedProtobuf(const meshtastic_MeshPac } else { LOG_DEBUG("StoreForwardpp End of chain does not match! Checking distance behind."); int64_t links_behind = 0; - if (t->chain_count != 0) { + if (t->chain_count != 0 && t->chain_count > chain_end.counter) { links_behind = t->chain_count - chain_end.counter; LOG_DEBUG("StoreForwardpp Links behind: %ld", links_behind);