Skip to content

Commit

Permalink
check bounds before normalizing (keybase#24292)
Browse files Browse the repository at this point in the history
* check bounds before normalizing

* fix fmt error

* -_-
  • Loading branch information
joshblum authored Aug 17, 2020
1 parent 1c032f6 commit 5125de0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions go/engine/cryptocurrency.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func (e *CryptocurrencyEngine) SubConsumers() []libkb.UIConsumer {
}

func normalizeAddress(address string) string {
if len(address) <= 3 {
return address
}
switch strings.ToLower(address)[0:3] {
case "bc1", "zs1":
// bech32 addresses require that cases not be mixed
Expand Down
3 changes: 2 additions & 1 deletion go/kbfs/data/data_mocks_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion go/kbfs/libkbfs/data_mocks_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions go/kbfs/libkbfs/libkbfs_mocks_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion go/kbfs/libkbfs/libkey_mocks_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5125de0

Please sign in to comment.