From 568909800c37f53d722649cc70be4b6d1a8ffa73 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Wed, 28 Sep 2016 12:00:48 +0100 Subject: [PATCH] Allow empty tar header to be read to know there are no more tar headers to read --- src/SharpCompress/Common/Tar/Headers/TarHeader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SharpCompress/Common/Tar/Headers/TarHeader.cs b/src/SharpCompress/Common/Tar/Headers/TarHeader.cs index d8178c13..ec51b157 100644 --- a/src/SharpCompress/Common/Tar/Headers/TarHeader.cs +++ b/src/SharpCompress/Common/Tar/Headers/TarHeader.cs @@ -164,9 +164,9 @@ namespace SharpCompress.Common.Tar.Headers { byte[] buffer = reader.ReadBytes(BlockSize); - if (buffer.Length < BlockSize) + if (buffer.Length != 0 && buffer.Length < BlockSize) { - throw new InvalidOperationException(); + throw new InvalidOperationException("Buffer is invalid size"); } return buffer; }