fix(gui): prevent nullptr dereference when VFS mode is unavailable#10176
Open
troed wants to merge 1 commit into
Open
fix(gui): prevent nullptr dereference when VFS mode is unavailable#10176troed wants to merge 1 commit into
troed wants to merge 1 commit into
Conversation
… askExperimentalVirtualFilesFeature The switch statement on Vfs::Mode lacked a default case. When an unexpected VFS mode is returned, msgBox remains nullptr and msgBox->open() causes a segfault. Added a default case that calls callback(false) and returns early. Assisted-by: Qwen:qwen-3.6-35b-a3b Signed-off-by: Troed Sångberg <github@troed.se>
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.
The switch statement on Vfs::Mode lacked a default case. When no VFS mode is available, msgBox remains nullptr and msgBox->open() causes a segfault. Added a default case that calls callback(false) and returns early.
Assisted-by: Qwen:qwen-3.6-35b-a3b
Resolves
#10174
Summary
OpenSUSE Tumbleweed has a separate package for VFS. If the user tries to enable VFS without it the previous code dereferenced a null pointer and segfaulted. This fix solves the crash and the user just sees that enabling VFS doesn't "stick". I opted against adding a dialog explaining why to not increase translation work for what I expect to believe an edge case.
TODO
Checklist
AI (if applicable)