Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rules/sdk: G703 errors not propagated should obey hash.Hash.Write not returning an error #62

Open
odeke-em opened this issue Oct 22, 2022 · 0 comments
Assignees

Comments

@odeke-em
Copy link
Collaborator

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
Screen Shot 2022-10-21 at 9 30 25 PM

We should check that the writer was of the type hash.Hash and ignore such reports.

@odeke-em odeke-em self-assigned this Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant