Skip to content

Commit d703157

Browse files
committed
Fixed issue #28 related to handling of ReadToEnd causing an OutOfMemory exception.
1 parent 5a5cbb3 commit d703157

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

NtApiDotNet/NtObjectUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ internal static void WriteNulTerminated(this BinaryWriter writer, string str)
7373

7474
internal static byte[] ReadToEnd(this BinaryReader reader)
7575
{
76-
return reader.ReadBytes(int.MaxValue);
76+
return reader.ReadBytes((int)reader.RemainingLength());
7777
}
7878

7979
internal static long RemainingLength(this Stream stm)

0 commit comments

Comments
 (0)