NtfsLib icon indicating copy to clipboard operation
NtfsLib copied to clipboard

error in NtfsCopy [bug] [fixed]

Open Acebond opened this issue 3 years ago • 0 comments

Hello There seems to be a bug in NtfsCopy https://github.com/LordMike/NtfsLib/blob/master/NtfsCopy/Program.cs#L152

byte[] buff = new byte[65535]; This throws an error when the file is larger than 65535 bytes in size.

The fileStream.Read(buff, 0, buff.Length); function returns a size larger than buff.

I fixed the issues by using a buff size that is divisible by 512. So 65536.

In the screenshot below, I added a print statement for the read() function, which read 65536 image

Acebond avatar Jul 16 '21 06:07 Acebond