Skip to content

Commit

Permalink
usbwallet: check returned error when decoding hexstr (#18056)
Browse files Browse the repository at this point in the history
* usbwallet: check returned error when decoding hexstr

* Update accounts/usbwallet/ledger.go

Co-Authored-By: CoreyLin <[email protected]>

* usbwallet: check hex decode error
  • Loading branch information
CoreyLin authored and holiman committed Dec 13, 2018
1 parent 4e6f53a commit b3be9b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion accounts/usbwallet/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, er

// Decode the hex sting into an Ethereum address and return
var address common.Address
hex.Decode(address[:], hexstr)
if _, err = hex.Decode(address[:], hexstr); err != nil {
return common.Address{}, err
}
return address, nil
}

Expand Down

0 comments on commit b3be9b7

Please sign in to comment.