Description
In src/Servy.Core/Domain/Service.cs (line 464):
RotationSizeInBytes = (ulong)RotationSize * 1024UL * 1024UL,
RotationSize is an int. There is no validation that it is positive before the cast to ulong. A negative value (e.g., from an unchecked database row or deserialization) would wrap to a very large ulong, effectively disabling log rotation.
Severity
Warning — silent data corruption.
Suggested fix
Add validation that RotationSize > 0 before conversion, or clamp to a minimum of 1.
Description
In
src/Servy.Core/Domain/Service.cs(line 464):RotationSizeis anint. There is no validation that it is positive before the cast toulong. A negative value (e.g., from an unchecked database row or deserialization) would wrap to a very largeulong, effectively disabling log rotation.Severity
Warning — silent data corruption.
Suggested fix
Add validation that
RotationSize > 0before conversion, or clamp to a minimum of 1.