diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 889de43e0add..2afce8eb0f15 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -246,7 +246,12 @@ func runCmd(ctx *cli.Context) error { } else { 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) if ctx.GlobalBool(CreateFlag.Name) {