Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GVFS/GVFS.Common/Git/GitRepo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private static bool ReadLooseObjectHeader(Stream input, out long size)
size = 0;

byte[] buffer = new byte[5];
input.Read(buffer, 0, buffer.Length);
input.ReadExactly(buffer, 0, buffer.Length);
if (!Enumerable.SequenceEqual(buffer, LooseBlobHeader))
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ internal static int GetIndexFileCount(GVFSEnlistment enlistment, PhysicalFileSys
* the 4 bytes at offsets 8-11 of the index file. */
indexFile.Position = 8;
var bytes = new byte[4];
indexFile.Read(
indexFile.ReadExactly(
bytes, // Destination buffer
offset: 0, // Offset in destination buffer, not in indexFile
count: 4);
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.UnitTests/Mock/ReusableMemoryStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public string ReadAt(long position, long length)
this.Position = position;

byte[] bytes = new byte[length];
this.Read(bytes, 0, (int)length);
this.ReadExactly(bytes, 0, (int)length);

this.Position = lastPosition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,11 @@ private FileSystemTaskResult ParseIndex(

private void ReadNextPage()
{
// Last page may be smaller than PageSize; partial fill is safe because
// the parser stops after entryCount entries and never reads stale bytes.
#pragma warning disable CA2022 // Avoid inexact read
this.indexStream.Read(this.page, 0, PageSize);
#pragma warning restore CA2022
this.nextByteIndex = 0;
}

Expand Down
Loading