From 94789ce455cf88cbe0636abc0071c1c03d4a2ebf Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Tue, 11 Feb 2025 03:04:18 +0100 Subject: [PATCH] Fix condition in rar v3 code --- src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs b/src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs index c62d5906..732c57e8 100644 --- a/src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs +++ b/src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs @@ -263,7 +263,7 @@ internal sealed partial class Unpack : BitInput, IRarUnpack, IDisposable if (((wrPtr - unpPtr) & PackDef.MAXWINMASK) < 260 && wrPtr != unpPtr) { UnpWriteBuf(); - if (destUnpSize <= 0) + if (destUnpSize < 0) { return; } @@ -713,7 +713,7 @@ internal sealed partial class Unpack : BitInput, IRarUnpack, IDisposable private void UnpWriteData(byte[] data, int offset, int size) { - if (destUnpSize <= 0) + if (destUnpSize < 0) { return; }