Skip to content

Commit

Permalink
file_open: don't bother with normalize path if trying to open \..
Browse files Browse the repository at this point in the history
  • Loading branch information
maharmstone committed Mar 17, 2023
1 parent dc55e1b commit 69ea164
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ntfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ static EFI_STATUS EFIAPI file_open(struct _EFI_FILE_HANDLE* File, struct _EFI_FI
if (fn.empty())
return EFI_NOT_FOUND;

if (file->ino == NTFS_ROOT_DIR_INODE && fn == u"..")
return EFI_INVALID_PARAMETER;

Status = normalize_path(fn, u16string_view(file->name, file->name_len), name, name_len);
if (EFI_ERROR(Status)) {
do_print_error("normalize_path", Status);
Expand Down

0 comments on commit 69ea164

Please sign in to comment.