Skip to content

Commit dbe41e4

Browse files
committed
keyverification: handle response allocation failure
1 parent a58daf0 commit dbe41e4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/modules/KeyVerificationModule.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ meshtastic_MeshPacket *KeyVerificationModule::allocReply()
279279
memcpy(response.hash2.bytes, hash2, 32);
280280

281281
responsePacket = allocDataProtobuf(response);
282+
if (!responsePacket) {
283+
LOG_WARN("Key Verification response allocation failed");
284+
ignoreRequest = true;
285+
resetToIdle();
286+
return nullptr;
287+
}
282288

283289
// PKI-encrypt the response only if we already held the requester's key. In the bootstrap case it goes
284290
// out channel-encrypted so the requester (who lacks our key) can decode it and read hash1.

0 commit comments

Comments
 (0)