Fixing wrong range validations

This commit is contained in:
2024-06-28 21:37:00 +02:00
parent 206c5420e1
commit 1536c60336
4 changed files with 29 additions and 17 deletions

View File

@@ -46,7 +46,7 @@ namespace AMWD.Protocols.Modbus.Proxy
ListenAddress = listenAddress ?? IPAddress.Loopback;
if (ushort.MinValue < listenPort || listenPort < ushort.MaxValue)
if (listenPort < ushort.MinValue || ushort.MaxValue < listenPort)
throw new ArgumentOutOfRangeException(nameof(listenPort));
try