diff options
author | Corey Lin <514971757@qq.com> | 2018-12-13 17:21:52 +0800 |
---|---|---|
committer | Martin Holst Swende <martin@swende.se> | 2018-12-13 17:21:52 +0800 |
commit | b3be9b7cd8f5f0e828d4d2aa6db1216ccd32ce3a (patch) | |
tree | c70cb5dfc8129a52a3ae24b3c23ab93354eb7de8 /accounts/usbwallet | |
parent | 4e6f53ac3360c4e90fdb419e7073e4316b2a49f7 (diff) | |
download | dexon-b3be9b7cd8f5f0e828d4d2aa6db1216ccd32ce3a.tar.gz dexon-b3be9b7cd8f5f0e828d4d2aa6db1216ccd32ce3a.tar.zst dexon-b3be9b7cd8f5f0e828d4d2aa6db1216ccd32ce3a.zip |
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
Diffstat (limited to 'accounts/usbwallet')
-rw-r--r-- | accounts/usbwallet/ledger.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 7d5f67908..c30903b5b 100644 --- a/accounts/usbwallet/ledger.go +++ b/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 } |