Unverified Commit 7d7a9653 authored by jwasinger's avatar jwasinger Committed by GitHub

cmd/evm: ensure input length is even (#24721)

* cmd/evm: ensure input length is even

* cmd/evm: minor nit + lintfix
Co-authored-by: 's avatarMartin Holst Swende <martin@swende.se>
parent 9e0a1000
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment