concourse
concourse copied to clipboard
kernel: Use unix.ByteSliceToString for safe release string handling
Replace manual byte conversion and null terminator handling with the standard unix.ByteSliceToString function from golang.org/x/sys/unix. This improves cross-platform compatibility and eliminates potential panic conditions when processing kernel release strings.
The previous implementation manually converted syscall.Utsname.Release byte-by-byte and required explicit null terminator handling, which could fail on certain platforms due to type differences or if the string filled the entire buffer.
See https://github.com/moby/moby/blob/master/pkg/parsers/kernel/kernel_unix.go