Skip to content

fix(simulator): potential buffer overflow in SD manager - #7521

Merged
pfeerick merged 2 commits into
2.12from
philmoz/fix-file-browser
Jul 5, 2026
Merged

fix(simulator): potential buffer overflow in SD manager#7521
pfeerick merged 2 commits into
2.12from
philmoz/fix-file-browser

Conversation

@philmoz

@philmoz philmoz commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

When browsing the radio storage card in the SD manager the 'getFullPath' function may overflow the 'full_path' string in the simulator.

The 'f_chdir' function does not correctly handle '..' when passed as the filename so the current path continues to grow - e.g. after navigating a few folders it may look like //BACKUP/../SOUNDS/en/../../FIRMWARE. Eventually this will overflow the full_path buffer.

Seen in MacOS, not tested on Linux or Window. Does not happen on the radio; but the fix will work for all cases.

PR #7485 fixes the issue for 3.0.

@philmoz philmoz added this to the 2.12.3 milestone Jul 3, 2026
@philmoz philmoz added bug 🪲 Something isn't working simulator labels Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5fa94298-8fd9-461e-85e6-6663c2f22ee0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch philmoz/fix-file-browser

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@philmoz
philmoz force-pushed the philmoz/fix-file-browser branch from 7445578 to 6275987 Compare July 3, 2026 22:32
@pfeerick pfeerick added the color Related generally to color LCD radios label Jul 4, 2026
Comment thread radio/src/gui/colorlcd/libui/file_browser.cpp Outdated
Comment thread radio/src/gui/colorlcd/libui/file_browser.h Outdated
@pfeerick

pfeerick commented Jul 5, 2026

Copy link
Copy Markdown
Member

Works fine on Linux also, will test Windows once the merge build is done as caching needed to be disabled due to an upstream bug before Windows builds consistently work again for 2.12.

This also resolves an issue where .. let you escape the SD storage folder, and walk higher up the directory tree etc.

@pfeerick
pfeerick merged commit 691ca49 into 2.12 Jul 5, 2026
55 of 59 checks passed
@pfeerick
pfeerick deleted the philmoz/fix-file-browser branch July 5, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working color Related generally to color LCD radios simulator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants