mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-10-21 21:12:03 +00:00
fix(companion): signing takes the buffer it can get (#38)
CMD_SIGN_START promised the app 8K before a malloc it never checked. On the L1 the nRF52 heap has ~5K free from boot, so the malloc always failed and every CMD_SIGN_DATA answered ERR_CODE_BAD_STATE. Now it allocates first, halving down to 256 B, and reports the size it got; nothing at all is an error on SIGN_START itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -633,6 +633,7 @@ private:
|
||||
uint8_t app_target_ver;
|
||||
uint8_t *sign_data;
|
||||
uint32_t sign_data_len;
|
||||
uint32_t sign_data_cap; // what the malloc got: at most MAX_SIGN_DATA_LEN
|
||||
unsigned long dirty_contacts_expiry;
|
||||
unsigned long _bot_last_ch_reply_ms;
|
||||
unsigned long _bot_last_room_reply_ms;
|
||||
|
||||
Reference in New Issue
Block a user