Skip to content

Commit a6fa0fa

Browse files
authored
Merge pull request #621 from rhodosaur/fix619
Include missing zlib compression level header checks
2 parents a0fb5ac + 480626d commit a6fa0fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NerdBank.GitVersioning/ManagedGit/ZLibStream.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public ZLibStream(Stream stream, long length = -1)
5656
Span<byte> zlibHeader = stackalloc byte[2];
5757
stream.ReadAll(zlibHeader);
5858

59-
if (zlibHeader[0] != 0x78 || (zlibHeader[1] != 0x01 && zlibHeader[1] != 0x9C))
59+
if (zlibHeader[0] != 0x78 || (zlibHeader[1] != 0x01 && zlibHeader[1] != 0x9C && zlibHeader[1] != 0x5E && zlibHeader[1] != 0xDA))
6060
{
61-
throw new GitException();
61+
throw new GitException($"Invalid zlib header {zlibHeader[0]:X2} {zlibHeader[1]:X2}");
6262
}
6363
}
6464

0 commit comments

Comments
 (0)