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

fix: do not panic running invalid file specifier #25530

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

yazan-abdalrahman
Copy link
Contributor

@yazan-abdalrahman yazan-abdalrahman commented Sep 9, 2024

This update prevents a panic in specifier_to_file_path on Windows by validating the file URL before calling to_file_path(). It ensures that:

Paths are checked to be absolute and are converted if needed.
The path is verified to exist before passing it to to_file_path(), ensuring invalid paths don't cause the application to crash.
This fix gracefully handles invalid or non-standard file URLs, avoiding panics during path resolution.

fix #20056

Co-authored-by: Bedis Nbiba [email protected]

@yazan-abdalrahman
Copy link
Contributor Author

@bartlomieju @dsherret
Please verify this solution again. I overwrite it

… handle-invalid-path-error-denoland#20062

# Conflicts:
#	cli/graph_util.rs
#	cli/lsp/config.rs
#	runtime/permissions/lib.rs
@dsherret dsherret changed the title fix: handle invalid path error fix: do not panic running invalid file specifier Sep 17, 2024
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@dsherret dsherret enabled auto-merge (squash) September 17, 2024 18:09
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.

Bug: Panic when trying to run invalid file
2 participants