Disallow creating files with '..' (#3156)

Release Notes:

- Fixed a crash that could occur when creating files with '..' in the
path
This commit is contained in:
Conrad Irwin 2024-01-08 15:43:57 -07:00 committed by GitHub
commit 59a1648445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 25 deletions

View file

@ -4936,10 +4936,10 @@ async fn test_project_symbols(
.await
.unwrap();
buffer_b_2.read_with(cx_b, |buffer, _| {
buffer_b_2.read_with(cx_b, |buffer, cx| {
assert_eq!(
buffer.file().unwrap().path().as_ref(),
Path::new("../crate-2/two.rs")
buffer.file().unwrap().full_path(cx),
Path::new("/code/crate-2/two.rs")
);
});