Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash parsing invalid file uri #3301

Merged

Conversation

WetDesertRock
Copy link
Contributor

Description:

storage/repository/parse.go assumed that there would always be a colon terminating the scheme. As seen in #3275 this led to an unexpected panic.

Note that I'm not as familiar with the usage of URI's in fyne, and this does make the code less lenient and throw errors more often (in theory). For example, "path/to/file" now expected to throw an error. After some research I think this is acceptable behavior as I don't see any way for those 'URI's to work. Let me know if this isn't a valid assumption and I can resubmit with a different fix in place (targeting just the reported issue)

Fixes #3275

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.
  • Any breaking changes have a deprecation path or have been discussed.

@coveralls
Copy link

coveralls commented Oct 2, 2022

Coverage Status

Coverage decreased (-0.001%) to 61.41% when pulling 6d73ff8 on WetDesertRock:crash_parsing_invalid_file_URI into 23d1052 on fyne-io:develop.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. While the fix seems to work, I think the previous solution to getting the scheme was slow and unnecessary complex. It would be better if we just removed it in favour of a better solution. I have proposed one in the comments.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Good call about the URI not necessarily having ://.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me now. Thanks your for all the work that has gone into it and congratulations on your first contribution to Fyne 🙂

@Jacalz Jacalz merged commit d695fd7 into fyne-io:develop Oct 4, 2022
@WetDesertRock WetDesertRock deleted the crash_parsing_invalid_file_URI branch October 4, 2022 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants