Skip to content

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

@odeke-em

Description

@odeke-em

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions