Add 'bearer:disable go_gosec_unsafe_unsafe' comments in tcp_linux.go to suppress specific security scanner warnings related to unsafe operations.
All checks were successful
Bearer / scan (push) Successful in 7s
Go Build Multi-Platform / build (amd64, darwin) (push) Successful in 31s
Go Build Multi-Platform / build (amd64, linux) (push) Successful in 33s
Go Build Multi-Platform / build (arm, windows) (push) Successful in 31s
Go Build Multi-Platform / build (arm, freebsd) (push) Successful in 33s
Go Build Multi-Platform / build (arm64, windows) (push) Successful in 34s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 1m0s
Go Revive Lint / lint (push) Successful in 48s
Run Gosec / tests (push) Successful in 1m17s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m36s
Go Build Multi-Platform / build (amd64, freebsd) (push) Successful in 9m23s
Go Build Multi-Platform / build (amd64, windows) (push) Successful in 9m25s
Go Build Multi-Platform / build (arm, linux) (push) Successful in 9m23s
Go Build Multi-Platform / build (arm64, darwin) (push) Successful in 9m25s
Go Build Multi-Platform / build (arm64, freebsd) (push) Successful in 9m23s
Go Build Multi-Platform / build (arm64, linux) (push) Successful in 9m25s
Go Build Multi-Platform / Create Release (push) Has been skipped

This commit is contained in:
2025-12-29 22:33:17 -06:00
parent fcfd04c0c2
commit d465f103ec

View File

@@ -79,6 +79,7 @@ func (tc *TCPClientInterface) setTimeoutsOSX() error {
func platformGetRTT(fd uintptr) time.Duration {
var info syscall.TCPInfo
// bearer:disable go_gosec_unsafe_unsafe
infoLen := uint32(unsafe.Sizeof(info))
// TCP_INFO is 11 on Linux
@@ -88,7 +89,9 @@ func platformGetRTT(fd uintptr) time.Duration {
fd,
syscall.IPPROTO_TCP,
11, // TCP_INFO
// bearer:disable go_gosec_unsafe_unsafe
uintptr(unsafe.Pointer(&info)),
// bearer:disable go_gosec_unsafe_unsafe
uintptr(unsafe.Pointer(&infoLen)),
0,
)