usbwallet: check returned error when decoding hexstr (#18056)

* usbwallet: check returned error when decoding hexstr

* Update accounts/usbwallet/ledger.go

Co-Authored-By: CoreyLin <514971757@qq.com>

* usbwallet: check hex decode error
pull/18324/head
Corey Lin 6 years ago committed by Martin Holst Swende
parent 4e6f53ac33
commit b3be9b7cd8
  1. 4
      accounts/usbwallet/ledger.go

@ -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
}

Loading…
Cancel
Save