pbatard / uefi-ntfs

UEFI:NTFS - Boot NTFS or exFAT partitions from UEFI
GNU General Public License v2.0
779 stars 133 forks source link

SetPathCase may cause infinite loop on some implementations. #6

Closed linnaea closed 8 years ago

linnaea commented 8 years ago

On some UEFI implementation (several MSI motherboard), when EFI_FILE_PROTOCOL.Read() returns a zero-length buffer, the original content of the buffer is not set to zero, and the loop on line 193 will never terminate if the file cannot be found.

pbatard commented 8 years ago

Good call.

I agree that the loop should use while (Size != 0); as you did in uefi-ntfs-multiboot.

For good measure, I also think I'll add a:

ZeroMem(FileInfo, Size);

before:

Status = FileHandle->Read(FileHandle, &Size, (VOID*)FileInfo);

just to be on the safe side.

Many thanks for the report!

By the way, I'm the process of integrating some of your changes from uefi-ntfs-multiboot into uefi-ntfs, as I think you did some very good work there. :+1: