Commit 00f3ef7
committed
fix out_frame buffer overflow in companion radio response handlers
The onContactResponse handler copies peer response data into out_frame
(MAX_FRAME_SIZE + 1 bytes) without checking whether the data fits. A
peer response with len close to MAX_PACKET_PAYLOAD (184) writes up to
188 bytes into the 173-byte buffer, overflowing by 15 bytes.
This affects the status response, telemetry response, and binary
response code paths. A malicious peer can trigger the overflow by
sending a large response payload, corrupting the stack.
Cap each memcpy to the remaining space in out_frame before copying.1 parent df01fd3 commit 00f3ef7
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
697 | | - | |
698 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
699 | 701 | | |
700 | 702 | | |
701 | 703 | | |
| |||
705 | 707 | | |
706 | 708 | | |
707 | 709 | | |
708 | | - | |
709 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
710 | 714 | | |
711 | 715 | | |
712 | 716 | | |
| |||
716 | 720 | | |
717 | 721 | | |
718 | 722 | | |
719 | | - | |
720 | | - | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
721 | 727 | | |
722 | 728 | | |
723 | 729 | | |
| |||
0 commit comments