Repository navigation
fix: prevent null pointer dereference by validating file object before caching check - #6723
Merged
Merged
Conversation
Collaborator
|
Do you mind adding some tests for this as well? |
Collaborator
|
CI doesn't seem happy about the tests. The commit message should be limited to 80 chars per line. The prefixes should be Let's also add |
IGS-GIT
force-pushed
the
main
branch
3 times, most recently
from
July 2, 2026 18:07
a18d3ce to
3962815
Compare
Contributor
Author
Collaborator
|
LGTM, but the fixes tag is in the wrong commit, and we still have a >80 line. |
Verify that the file object is valid before checking its cached path to avoid a potential NULL pointer dereference. Fixes: c4fce9e ("run: Error out if file forwarding of empty paths is attempted")
Add regression tests to verify that remote URIs and local files can be forwarded correctly, and that empty paths result in an error.
Contributor
Author
Sorry got sidetracked with the test cases. I made the requested changes. Should be all good now |
swick
enabled auto-merge
July 3, 2026 17:14
Collaborator
|
Thanks a lot! |
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.

Commit c4fce9e added a check to fail early when file-forwarding is attempted with empty paths (fixing a crash in #6689). However, the check flatpak_file_get_path_cached (file) == NULL is too broad:
This was fixed by ensuring we only fail on NULL caches paths if a local file object was created/recognized. URLs are now exempt from this check
Fixes: c4fce9e ("run: Error out if file forwarding of empty paths is attempted")