~ruther/NosSmooth

9bb918f07f3829949eac61efaf6fe9c9ecf20b5c — František Boháček 3 years ago e9e9f8b
fix(data): correctly decrypt 0 length lst files
1 files changed, 6 insertions(+), 1 deletions(-)

M Data/NosSmooth.Data.NOSFiles/Decryptors/LstDecryptor.cs
M Data/NosSmooth.Data.NOSFiles/Decryptors/LstDecryptor.cs => Data/NosSmooth.Data.NOSFiles/Decryptors/LstDecryptor.cs +6 -1
@@ 15,8 15,13 @@ public class LstDecryptor : IDecryptor
    /// <inheritdoc />
    public Result<byte[]> Decrypt(ReadOnlySpan<byte> data)
    {
        if (data.Length == 0)
        {
            return Array.Empty<byte>();
        }

        var output = new MemoryStream();
        int linesCount = BinaryPrimitives.ReadInt32LittleEndian(data);
        var linesCount = BinaryPrimitives.ReadInt32LittleEndian(data);
        data = data.Slice(4);
        for (var i = 0; i < linesCount; i++)
        {

Do not follow this link