fix: handle error when generating random tag in RequestPath method
All checks were successful
Go Build Multi-Platform / build (amd64, darwin) (push) Successful in 31s
Go Build Multi-Platform / build (arm, freebsd) (push) Successful in 32s
Bearer / scan (push) Successful in 7s
Go Build Multi-Platform / build (amd64, linux) (push) Successful in 32s
Go Build Multi-Platform / build (arm, windows) (push) Successful in 32s
Go Build Multi-Platform / build (wasm, js) (push) Successful in 44s
Go Build Multi-Platform / build (arm64, windows) (push) Successful in 47s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 51s
Go Revive Lint / lint (push) Successful in 1m1s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m44s
Run Gosec / tests (push) Successful in 1m7s
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, freebsd) (push) Successful in 9m23s
Go Build Multi-Platform / build (arm64, darwin) (push) Successful in 9m25s
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-30 12:13:49 -06:00
parent cbff6e4bc4
commit 25e0719954

View File

@@ -553,7 +553,9 @@ func (t *Transport) NextHopInterface(destinationHash []byte) string {
func (t *Transport) RequestPath(destinationHash []byte, onInterface string, tag []byte, recursive bool) error {
if tag == nil {
tag = make([]byte, common.SIZE_16)
rand.Read(tag)
if _, err := rand.Read(tag); err != nil {
return fmt.Errorf("failed to generate random tag: %w", err)
}
}
var pathRequestData []byte