diff --git a/XenCenterLib/StreamUtilities.cs b/XenCenterLib/StreamUtilities.cs index 71268585c..6bea05265 100644 --- a/XenCenterLib/StreamUtilities.cs +++ b/XenCenterLib/StreamUtilities.cs @@ -84,13 +84,10 @@ namespace XenCenterLib if (bytesRead <= 0) break; - if (buffer.Any(b => b != 0x0)) + if (offset + bytesRead < limit) { - if (offset + bytesRead < limit) - { - // This is not the last block. Compute the partial hash. - hashAlgorithm.TransformBlock(buffer, 0, bytesRead, buffer, 0); - } + // This is not the last block. Compute the partial hash. + hashAlgorithm.TransformBlock(buffer, 0, bytesRead, buffer, 0); } offset += bytesRead;