mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-17 09:01:30 +10:00
Null-check packet allocations in allocForSending and its callers (#11086)
* Null-check packet allocations in allocForSending and its callers
Sibling of 0ae44d701.
* Null-check allocDataProtobuf, allocAckNak and allocErrorResponse callers
Second tier of the same nullable contract.
* Keep telemetry sleep scheduling on allocation failure
Allocation failure now marks the telemetry invalid instead of returning
early, so power-saving SENSOR nodes still arm deep sleep.
This commit is contained in:
@@ -169,6 +169,8 @@ bool KeyVerificationModule::sendInitialRequest(NodeNum remoteNode)
|
||||
KeyVerification.hash1.size = 32;
|
||||
memcpy(KeyVerification.hash1.bytes, owner.public_key.bytes, 32);
|
||||
meshtastic_MeshPacket *p = allocDataProtobuf(KeyVerification);
|
||||
if (!p)
|
||||
return false;
|
||||
p->to = remoteNode;
|
||||
p->channel = 0;
|
||||
// Only request PKI when we already hold the destination's key. Otherwise this first message goes out
|
||||
@@ -325,6 +327,8 @@ void KeyVerificationModule::processSecurityNumber(uint32_t incomingNumber)
|
||||
KeyVerification.hash1.size = 32;
|
||||
memcpy(KeyVerification.hash1.bytes, hash1, 32);
|
||||
meshtastic_MeshPacket *p = allocDataProtobuf(KeyVerification);
|
||||
if (!p)
|
||||
return;
|
||||
p->to = currentRemoteNode;
|
||||
p->channel = 0;
|
||||
p->pki_encrypted = true;
|
||||
|
||||
Reference in New Issue
Block a user