From 0349d5aac13449e669de4e1d88feff28d2264027 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 05:34:05 +0000 Subject: [PATCH 1/2] Initial plan From 6b15741379a71e3acc7d921a1824c251426a2066 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 05:36:37 +0000 Subject: [PATCH 2/2] Fix off-by-one errors in IP and port range calculations Co-authored-by: aahmed-spec <250927798+aahmed-spec@users.noreply.github.com> --- src/powershell/tests/Test-Assessment.25395.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/powershell/tests/Test-Assessment.25395.ps1 b/src/powershell/tests/Test-Assessment.25395.ps1 index 8c3210a08..cd5575438 100644 --- a/src/powershell/tests/Test-Assessment.25395.ps1 +++ b/src/powershell/tests/Test-Assessment.25395.ps1 @@ -66,7 +66,7 @@ function Test-Assessment-25395 { $end = [System.Net.IPAddress]::Parse($matches[2]).GetAddressBytes() [array]::Reverse($start) [array]::Reverse($end) - return (([BitConverter]::ToUInt32($end,0) - [BitConverter]::ToUInt32($start,0)) -gt 255) + return (([BitConverter]::ToUInt32($end,0) - [BitConverter]::ToUInt32($start,0) + 1) -gt 256) } return $false } @@ -84,7 +84,7 @@ function Test-Assessment-25395 { $BroadPortRangeThreshold = 10 if ($Port -eq '1-65535') { return $true } - if ($Port -match '^(\d+)-(\d+)$' -and (([int]$matches[2] - [int]$matches[1]) -gt $BroadPortRangeThreshold)) { return $true } + if ($Port -match '^(\d+)-(\d+)$' -and (([int]$matches[2] - [int]$matches[1] + 1) -gt $BroadPortRangeThreshold)) { return $true } return $false }