Skip to content

Fix out-of-bounds read in VoiceKit::dfu_reboot_()#554

Open
teancom wants to merge 1 commit intoesphome:devfrom
teancom:fix/dfu-reboot-oob-read
Open

Fix out-of-bounds read in VoiceKit::dfu_reboot_()#554
teancom wants to merge 1 commit intoesphome:devfrom
teancom:fix/dfu-reboot-oob-read

Conversation

@teancom
Copy link
Copy Markdown
Contributor

@teancom teancom commented Feb 22, 2026

The reboot_req array had 3 elements but write() was called with a hardcoded length of 4, reading one byte past the array from the stack. Add the missing payload byte required by the XMOS DFU protocol and use sizeof(reboot_req) instead of a hardcoded length to prevent mismatch.

Note that this worked previously because the XMOS device doesn't actually care what's in the command byte, so any value we send is fine. This cleanup is to help save the next person who wonders why we declare are array of 3 bytes and send 4 bytes some worry, it changes no functionality.

The reboot_req array had 3 elements but write() was called with a
hardcoded length of 4, reading one byte past the array from the stack.
Add the missing payload byte required by the XMOS DFU protocol and use
sizeof(reboot_req) instead of a hardcoded length to prevent mismatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant