mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-12-04 07:50:56 +08:00
wait_for_beginfirmwareupdate() subtracted the source_node_id field from
the received length without checking the request was that long, so an
empty request wrapped the firmware path length to SIZE_MAX and the
following GetInfo and Read requests were built from far past the path
buffer. Keep waiting until a request long enough to hold the field
arrives.
The programming progress divided by fw_image_size / 100, which is zero
for images under 100 bytes, and an image down to the size of the app
descriptor is accepted. Scale the offset instead.
Reported by @doridoriJJ.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>
(cherry picked from commit f7191cdb30)