Skip to content

Commit

Permalink
Merge pull request #621 from rhodosaur/fix619
Browse files Browse the repository at this point in the history
Include missing zlib compression level header checks
  • Loading branch information
AArnott committed Jun 22, 2021
2 parents a0fb5ac + 480626d commit a6fa0fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NerdBank.GitVersioning/ManagedGit/ZLibStream.cs
Expand Up @@ -56,9 +56,9 @@ public ZLibStream(Stream stream, long length = -1)
Span<byte> zlibHeader = stackalloc byte[2];
stream.ReadAll(zlibHeader);

if (zlibHeader[0] != 0x78 || (zlibHeader[1] != 0x01 && zlibHeader[1] != 0x9C))
if (zlibHeader[0] != 0x78 || (zlibHeader[1] != 0x01 && zlibHeader[1] != 0x9C && zlibHeader[1] != 0x5E && zlibHeader[1] != 0xDA))
{
throw new GitException();
throw new GitException($"Invalid zlib header {zlibHeader[0]:X2} {zlibHeader[1]:X2}");
}
}

Expand Down

0 comments on commit a6fa0fa

Please sign in to comment.