Merge pull request #59 from KOLANICH/ZipFileEntry-LoadExtra-ArrayOverflowFix

Zip file entry load extra array overflow fix
This commit is contained in:
Adam Hathcock
2015-05-22 08:52:04 +01:00

View File

@@ -66,7 +66,7 @@ namespace SharpCompress.Common.Zip.Headers
protected void LoadExtra(byte[] extra)
{
for (int i = 0; i < extra.Length;)
for (int i = 0; i < extra.Length-4;)
{
ExtraDataType type = (ExtraDataType) BitConverter.ToUInt16(extra, i);
if (!Enum.IsDefined(typeof (ExtraDataType), type))