Conversation
Preserve selected FatFs long filenames without mutating the backing storage buffer. Remove the out-of-bounds ellipsis write, expand firmware filename capacity to the configured LFN limit, and prevent path-length accounting from wrapping at 255 bytes.
Mtek555
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve FatFs long filenames selected through Storage/Firmware Update instead of corrupting the fixed 32-byte backing filename buffer.
The original selection path copied into a 32-byte destination and then, for long names, wrote
"..."atlen - 4using the source filename length. With a 38-character firmware filename, that offset is beyond the destination buffer; the same valid CRC firmware image was then rejected on-device asInvalid image file!.This change:
FF_MAX_LFN=255plus NUL)size_tfor dynamic path-length accounting while preserving the callers' nonzero-success contractDirectory path capacity remains 64 bytes; this PR does not claim arbitrary deep-path support.
Validation
Invalid image file!; normal update confirmation reachedScope
Exactly three files:
m1_csrc/m1_file_browser.cm1_csrc/m1_storage.cm1_csrc/m1_storage.h