From dbe41e42a1ee3cd7f2bfdf20ee0aaa04677a664c Mon Sep 17 00:00:00 2001 From: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Date: Tue, 21 Jul 2026 10:10:34 -0700 Subject: [PATCH] keyverification: handle response allocation failure --- src/modules/KeyVerificationModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index adc05531f..f0a1dc8fb 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -279,6 +279,12 @@ meshtastic_MeshPacket *KeyVerificationModule::allocReply() memcpy(response.hash2.bytes, hash2, 32); responsePacket = allocDataProtobuf(response); + if (!responsePacket) { + LOG_WARN("Key Verification response allocation failed"); + ignoreRequest = true; + resetToIdle(); + return nullptr; + } // PKI-encrypt the response only if we already held the requester's key. In the bootstrap case it goes // out channel-encrypted so the requester (who lacks our key) can decode it and read hash1.