diff --git a/libs/common/RespReadUtils.cs b/libs/common/RespReadUtils.cs index 4554f97de3..8b93be12e0 100644 --- a/libs/common/RespReadUtils.cs +++ b/libs/common/RespReadUtils.cs @@ -378,7 +378,7 @@ public static bool ReadSignedLengthHeader(out int length, ref byte* ptr, byte* e } // Validate length - if (value > int.MaxValue) + if (value > int.MaxValue && (!negative || value > int.MaxValue + (ulong)1)) // int.MinValue = -(int.MaxValue + 1) { RespParsingException.ThrowIntegerOverflow(readHead - digitsRead, (int)digitsRead); }