mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 19:46:39 +00:00
cmd/evm: ensure input length is even (#24721)
* cmd/evm: ensure input length is even * cmd/evm: minor nit + lintfix Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
parent
9e0a10004e
commit
7d7a96530b
1 changed files with 6 additions and 1 deletions
|
|
@ -246,7 +246,12 @@ func runCmd(ctx *cli.Context) error {
|
||||||
} else {
|
} else {
|
||||||
hexInput = []byte(ctx.GlobalString(InputFlag.Name))
|
hexInput = []byte(ctx.GlobalString(InputFlag.Name))
|
||||||
}
|
}
|
||||||
input := common.FromHex(string(bytes.TrimSpace(hexInput)))
|
hexInput = bytes.TrimSpace(hexInput)
|
||||||
|
if len(hexInput)%2 != 0 {
|
||||||
|
fmt.Println("input length must be even")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
input := common.FromHex(string(hexInput))
|
||||||
|
|
||||||
var execFunc func() ([]byte, uint64, error)
|
var execFunc func() ([]byte, uint64, error)
|
||||||
if ctx.GlobalBool(CreateFlag.Name) {
|
if ctx.GlobalBool(CreateFlag.Name) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue