gosec
gosec copied to clipboard
rules/sdk: G703 errors not propagated should obey hash.Hash.Write not returning an error
I've seen this error
[/go/src/github.com/cosmos/cosmos-sdk/crypto/hd/hdpath.go:269] - G703 (CWE-): Returned error is not propagated up the stack. (Confidence: HIGH, Severity: LOW)
268: // sha512 does not err
> 269: _, _ = mac.Write(data)
270:
but really if we examine the signature per https://pkg.go.dev/hash#Hash we can see
We should check that the writer was of the type hash.Hash and ignore such reports.