File CVE-2025-22870.patch of Package amazon-ssm-agent.37787

diff -Nru amazon-ssm-agent-3.3.1611.0.orig/vendor/golang.org/x/net/proxy/per_host.go amazon-ssm-agent-3.3.1611.0/vendor/golang.org/x/net/proxy/per_host.go
--- amazon-ssm-agent-3.3.1611.0.orig/vendor/golang.org/x/net/proxy/per_host.go	2025-01-16 22:26:50.000000000 +0100
+++ amazon-ssm-agent-3.3.1611.0/vendor/golang.org/x/net/proxy/per_host.go	2025-03-07 16:16:45.136659872 +0100
@@ -7,6 +7,7 @@
 import (
 	"context"
 	"net"
+	"net/netip"
 	"strings"
 )
 
@@ -57,7 +58,8 @@
 }
 
 func (p *PerHost) dialerForRequest(host string) Dialer {
-	if ip := net.ParseIP(host); ip != nil {
+	if nip, err := netip.ParseAddr(host); err == nil {
+		ip := net.IP(nip.AsSlice())
 		for _, net := range p.bypassNetworks {
 			if net.Contains(ip) {
 				return p.bypass
@@ -108,8 +110,8 @@
 			}
 			continue
 		}
-		if ip := net.ParseIP(host); ip != nil {
-			p.AddIP(ip)
+		if nip, err := netip.ParseAddr(host); err == nil {
+			p.AddIP(net.IP(nip.AsSlice()))
 			continue
 		}
 		if strings.HasPrefix(host, "*.") {
openSUSE Build Service is sponsored by