diff --git a/rEFIt_UEFI/libeg/image.cpp b/rEFIt_UEFI/libeg/image.cpp index aab1417f9..635bbcbc8 100644 --- a/rEFIt_UEFI/libeg/image.cpp +++ b/rEFIt_UEFI/libeg/image.cpp @@ -159,6 +159,7 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File } dirNameLen = p - FileName; StrnCpy(DirName, FileName, dirNameLen); + DirName[dirNameLen] = L'\0'; Status = BaseDir->Open(BaseDir, &FileHandle, DirName, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, EFI_FILE_DIRECTORY);